All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Wei Yongjun <weiyj.lk@gmail.com>,
	Vadim Pasternak <vadimp@mellanox.com>,
	Richard Purdie <rpurdie@rpsys.net>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, linux-leds@vger.kernel.org
Subject: Re: [PATCH -next] leds: mlxcpld: fix return value check in mlxcpld_led_init()
Date: Wed, 14 Sep 2016 08:55:30 +0200	[thread overview]
Message-ID: <e5b6b992-4881-3e7d-5904-a7d690c9e66d@samsung.com> (raw)
In-Reply-To: <1473778715-11283-1-git-send-email-weiyj.lk@gmail.com>

Hi Wei,

On 09/13/2016 04:58 PM, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function platform_device_register_simple() returns
> ERR_PTR() and never returns NULL. The NULL test in the return value
> check should be replaced with IS_ERR().
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/leds/leds-mlxcpld.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-mlxcpld.c b/drivers/leds/leds-mlxcpld.c
> index 125ddfa..2ba76c1 100644
> --- a/drivers/leds/leds-mlxcpld.c
> +++ b/drivers/leds/leds-mlxcpld.c
> @@ -401,9 +401,9 @@ static int __init mlxcpld_led_init(void)
>  	int err;
>
>  	pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
> -	if (!pdev) {
> +	if (IS_ERR(pdev)) {
>  		pr_err("Device allocation failed\n");
> -		return -ENOMEM;
> +		return PTR_ERR(pdev);
>  	}
>
>  	err = platform_driver_probe(&mlxcpld_led_driver, mlxcpld_led_probe);
>
>
>
>

Thanks for your patches. Would you mind if I merged them to the
original patch and added your Reviewed-by tag to the commit message?

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2016-09-14  6:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20160913145849eucas1p1c1661ef621a39d2955b29710a3729e7b@eucas1p1.samsung.com>
2016-09-13 14:58 ` [PATCH -next] leds: mlxcpld: fix return value check in mlxcpld_led_init() Wei Yongjun
2016-09-14  6:55   ` Jacek Anaszewski [this message]
2016-09-14  7:10     ` weiyongjun (A)
2016-09-14  8:56       ` Jacek Anaszewski

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=e5b6b992-4881-3e7d-5904-a7d690c9e66d@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    --cc=vadimp@mellanox.com \
    --cc=weiyj.lk@gmail.com \
    --cc=weiyongjun1@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.