From: Dan Carpenter <dan.carpenter@oracle.com>
To: Oded Gabbay <ogabbay@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ofir Bitton <obitton@habana.ai>,
Yuri Nudelman <ynudelman@habana.ai>,
farah kassabri <fkassabri@habana.ai>,
Alon Mizrahi <amizrahi@habana.ai>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] habanalabs: silence an uninitialized variable warning
Date: Tue, 11 Jan 2022 10:16:51 +0300 [thread overview]
Message-ID: <20220111071651.GB11243@kili> (raw)
Smatch warns that:
drivers/misc/habanalabs/common/command_buffer.c:471 hl_cb_ioctl()
error: uninitialized symbol 'device_va'.
Which is true, but harmless. Anyway, it's easy to silence this by
adding a error check.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/misc/habanalabs/common/command_buffer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/misc/habanalabs/common/command_buffer.c b/drivers/misc/habanalabs/common/command_buffer.c
index 3c0ae07a2d80..b9483a3cee91 100644
--- a/drivers/misc/habanalabs/common/command_buffer.c
+++ b/drivers/misc/habanalabs/common/command_buffer.c
@@ -464,6 +464,8 @@ int hl_cb_ioctl(struct hl_fpriv *hpriv, void *data)
args->in.flags,
&usage_cnt,
&device_va);
+ if (rc)
+ break;
memset(&args->out, 0, sizeof(args->out));
--
2.20.1
next reply other threads:[~2022-01-11 7:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-11 7:16 Dan Carpenter [this message]
2022-01-23 14:39 ` [PATCH] habanalabs: silence an uninitialized variable warning Oded Gabbay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220111071651.GB11243@kili \
--to=dan.carpenter@oracle.com \
--cc=amizrahi@habana.ai \
--cc=arnd@arndb.de \
--cc=fkassabri@habana.ai \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=obitton@habana.ai \
--cc=ogabbay@kernel.org \
--cc=ynudelman@habana.ai \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox