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: 02fe26f253
("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>
This commit is contained in:
parent
71698da37c
commit
ffa28312e2
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue