Skip to content

Commit ffa2831

Browse files
Dan Carpentergregkh
authored andcommitted
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: 02fe26f ("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]>
1 parent 71698da commit ffa2831

File tree

1 file changed

+1
-1
lines changed
  • drivers/base/firmware_loader

1 file changed

+1
-1
lines changed

drivers/base/firmware_loader/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ static void fw_log_firmware_info(const struct firmware *fw, const char *name, st
812812
char *outbuf;
813813

814814
alg = crypto_alloc_shash("sha256", 0, 0);
815-
if (!alg)
815+
if (IS_ERR(alg))
816816
return;
817817

818818
sha256buf = kmalloc(SHA256_DIGEST_SIZE, GFP_KERNEL);

0 commit comments

Comments
 (0)