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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 4 Mar 2019 10:28:11 +0800
From:   Liang Yang <liang.yang@...ogic.com>
To:     Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        <linux-amlogic@...ts.infradead.org>,
        <linux-mtd@...ts.infradead.org>
CC:     <bbrezillon@...nel.org>, <miquel.raynal@...tlin.com>,
        <richard@....at>, <jianxin.pan@...ogic.com>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] mtd: rawnand: meson: add missing ENOMEM check in
 meson_nfc_read_buf()

Hello Martin,

On 2019/3/2 1:38, Martin Blumenstingl wrote:
> kzalloc() can return NULL if memory could not be allocated. Check the
> return value of the kzalloc() call in meson_nfc_read_buf() to make it
> consistent with other memory allocations within the meson_nand driver.
> 
> Fixes: 8fae856c53500a ("mtd: rawnand: meson: add support for Amlogic NAND flash controller")
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
> ---
>   drivers/mtd/nand/raw/meson_nand.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
> index 3e8aa71407b5..a1d8506b61c7 100644
> --- a/drivers/mtd/nand/raw/meson_nand.c
> +++ b/drivers/mtd/nand/raw/meson_nand.c
> @@ -528,6 +528,9 @@ static int meson_nfc_read_buf(struct nand_chip *nand, u8 *buf, int len)
>   	u8 *info;
>   
>   	info = kzalloc(PER_INFO_BYTE, GFP_KERNEL);
> +	if (!info)
> +		return -ENOMEM;
> +

Thank you very much. it is really good to me.
Acked-by: Liang Yang <liang.yang@...ogic.com>

>   	ret = meson_nfc_dma_buffer_setup(nand, buf, len, info,
>   					 PER_INFO_BYTE, DMA_FROM_DEVICE);
>   	if (ret)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ