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]
Date:	Tue, 5 Jul 2016 15:08:45 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	David Miller <davem@...emloft.net>, weiyj_lk@....com
Cc:	yisen.zhuang@...wei.com, salil.mehta@...wei.com,
	yankejian@...wei.com, yongjun_wei@...ndmicro.com.cn,
	netdev@...r.kernel.org
Subject: Re: [PATCH -next] net: hns: fix return value check in
 hns_dsaf_get_cfg()

Hello.

On 7/5/2016 10:08 AM, David Miller wrote:

>>
>>  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ppe-base");
>> -	if (!res) {
>> +	if (!res)
>>  		res = platform_get_resource(pdev, IORESOURCE_MEM, res_idx++);
>> -		if (!res) {
>> -			dev_err(dsaf_dev->dev, "ppe-base info is needed!\n");
>> -			return -ENOMEM;
>> -		}
>> -	}
>
> platform_get_resource() can return NULL, you can't just remove this check.

    He can -- since devm_ioremap_resource() called right afterwards checks for 
NULL.

> This is also a case of a patch trying to do many things at once, and that's
> why bugs like this tend to slip in.

    Agreed.

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ