[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160705.000856.969400031985428200.davem@davemloft.net>
Date: Tue, 05 Jul 2016 00:08:56 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: 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()
From: weiyj_lk@....com
Date: Mon, 4 Jul 2016 15:00:58 +0000
>
> 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.
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.
Powered by blists - more mailing lists