netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: weiyj_lk@163.com
Cc: yisen.zhuang@huawei.com, salil.mehta@huawei.com,
	yankejian@huawei.com, yongjun_wei@trendmicro.com.cn,
	netdev@vger.kernel.org
Subject: Re: [PATCH -next] net: hns: fix return value check in hns_dsaf_get_cfg()
Date: Tue, 05 Jul 2016 00:08:56 -0700 (PDT)	[thread overview]
Message-ID: <20160705.000856.969400031985428200.davem@davemloft.net> (raw)
In-Reply-To: <1467644458-10131-1-git-send-email-weiyj_lk@163.com>

From: weiyj_lk@163.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.

  reply	other threads:[~2016-07-05  7:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04 15:00 [PATCH -next] net: hns: fix return value check in hns_dsaf_get_cfg() weiyj_lk
2016-07-05  7:08 ` David Miller [this message]
2016-07-05 12:08   ` Sergei Shtylyov
2016-07-05  7:56 ` [PATCH -next v2] " weiyj_lk
2016-07-05 17:21   ` David Miller
2016-09-05 14:20   ` Salil Mehta
2016-09-05 19:43     ` David Miller
2016-09-06  8:42       ` Salil Mehta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160705.000856.969400031985428200.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=weiyj_lk@163.com \
    --cc=yankejian@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).