diff options
author | Dan Carpenter <[email protected]> | 2023-05-16 11:12:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2023-05-31 20:31:00 +0100 |
commit | ffa28312e2837ae788855840e126fa6f8a1ac35d (patch) | |
tree | c8f494d4dd733b90efe8d72dc4e6c7f2043190d6 /drivers/base/firmware_loader/main.c | |
parent | 71698da37ce70c457751baea507a122851a2d481 (diff) |
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 <[email protected]>
Reviewed-by: Cezary Rojewski <[email protected]>
Acked-by: Luis Chamberlain <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/base/firmware_loader/main.c')
-rw-r--r-- | drivers/base/firmware_loader/main.c | 2 |
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); |