summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2023-05-16 10:12:51 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-31 21:31:00 +0200
commitffa28312e2837ae788855840e126fa6f8a1ac35d (patch)
treec8f494d4dd733b90efe8d72dc4e6c7f2043190d6 /drivers/base
parentMAINTAINERS: Vaibhav Gupta is the new ipack maintainer (diff)
downloadlinux-ffa28312e2837ae788855840e126fa6f8a1ac35d.tar.xz
linux-ffa28312e2837ae788855840e126fa6f8a1ac35d.zip
firmware_loader: Fix a NULL vs IS_ERR() check
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> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Acked-by: Luis Chamberlain <mcgrof@kernel.org> Link: https://lore.kernel.org/r/36ef6042-ce74-4e8e-9e2c-5b5c28940610@kili.mountain Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/firmware_loader/main.c2
1 files changed, 1 insertions, 1 deletions
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);