linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: bootc@bootc.net, yongjun_wei@trendmicro.com.cn,
	linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
	linux1394-devel@lists.sourceforge.net
Subject: Re: [PATCH] target: fix return value check in sbp_register_configfs()
Date: Sat, 22 Sep 2012 16:55:45 -0700	[thread overview]
Message-ID: <1348358145.8016.3.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <CAPgLHd-Ts0ABMCb0Y6Do_ovMVd20_i+XETkm7v17Thc7wR9-fg@mail.gmail.com>

On Fri, 2012-09-21 at 13:57 +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function target_fabric_configfs_init() returns
> ERR_PTR() not NULL pointer. The NULL test in the return value check
> should be replaced with IS_ERR().
> 
> dpatch engine is used to auto generated this patch.
> (https://github.com/weiyj/dpatch)
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/target/sbp/sbp_target.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
> index 39ddba5..773303e 100644
> --- a/drivers/target/sbp/sbp_target.c
> +++ b/drivers/target/sbp/sbp_target.c
> @@ -2556,9 +2556,9 @@ static int sbp_register_configfs(void)
>  	int ret;
>  
>  	fabric = target_fabric_configfs_init(THIS_MODULE, "sbp");
> -	if (!fabric) {
> +	if (IS_ERR(fabric)) {
>  		pr_err("target_fabric_configfs_init() failed\n");
> -		return -ENOMEM;
> +		return PTR_ERR(fabric);
>  	}
>  
>  	fabric->tf_ops = sbp_ops;
> 
> 

Good catch.  Applied to target-pending/for-next for the v3.7-rc1
target-updates PULL.

Thanks Wei !

      reply	other threads:[~2012-09-22 23:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21  5:57 [PATCH] target: fix return value check in sbp_register_configfs() Wei Yongjun
2012-09-22 23:55 ` Nicholas A. Bellinger [this message]

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=1348358145.8016.3.camel@haakon2.linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=bootc@bootc.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=target-devel@vger.kernel.org \
    --cc=weiyj.lk@gmail.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).