From: Cezary Rojewski <cezary.rojewski@intel.com>
To: "Dan Carpenter" <dan.carpenter@linaro.org>,
"Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
Russ Weight <russell.h.weight@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] firmware_loader: Fix a NULL vs IS_ERR() check
Date: Tue, 16 May 2023 10:23:54 +0200 [thread overview]
Message-ID: <bfcec885-9dc4-ff7f-f7ab-1481a8bae559@intel.com> (raw)
In-Reply-To: <36ef6042-ce74-4e8e-9e2c-5b5c28940610@kili.mountain>
On 2023-05-16 10:12 AM, Dan Carpenter wrote:
> The crypto_alloc_shash() function doesn't return NULL, it returns
> error pointers. Update the check accordingly.
>
> Fixes: 02fe26f25325 ("firmware_loader: Add debug message with checksum for FW file")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/base/firmware_loader/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
> index 9d79d5ad9102..b58c42f1b1ce 100644
> --- a/drivers/base/firmware_loader/main.c
> +++ b/drivers/base/firmware_loader/main.c
> @@ -812,7 +812,7 @@ static void fw_log_firmware_info(const struct firmware *fw, const char *name, st
> char *outbuf;
>
> alg = crypto_alloc_shash("sha256", 0, 0);
> - if (!alg)
> + if (IS_ERR(alg))
> return;
>
> sha256buf = kmalloc(SHA256_DIGEST_SIZE, GFP_KERNEL);
Thank you for the fix.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
next prev parent reply other threads:[~2023-05-16 8:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 8:12 Dan Carpenter
2023-05-16 8:23 ` Cezary Rojewski [this message]
2023-05-16 21:51 ` Luis Chamberlain
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=bfcec885-9dc4-ff7f-f7ab-1481a8bae559@intel.com \
--to=cezary.rojewski@intel.com \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=rafael@kernel.org \
--cc=russell.h.weight@intel.com \
/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
all inboxes | Powered by JetHome®