lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bfcec885-9dc4-ff7f-f7ab-1481a8bae559@intel.com>
Date:   Tue, 16 May 2023 10:23:54 +0200
From:   Cezary Rojewski <cezary.rojewski@...el.com>
To:     Dan Carpenter <dan.carpenter@...aro.org>,
        Amadeusz Sławiński 
        <amadeuszx.slawinski@...ux.intel.com>
CC:     Luis Chamberlain <mcgrof@...nel.org>,
        Russ Weight <russell.h.weight@...el.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        <linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH] firmware_loader: Fix a NULL vs IS_ERR() check

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@...aro.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@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ