[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1389098033.15325.10.camel@oc7383187364.ibm.com>
Date: Tue, 07 Jan 2014 13:33:53 +0100
From: Frank Haverkamp <haver@...ux.vnet.ibm.com>
To: Wei Yongjun <weiyj.lk@...il.com>
Cc: gregkh@...uxfoundation.org, yongjun_wei@...ndmicro.com.cn,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] misc: genwqe: fix return value check in
genwqe_device_create()
Am Dienstag, den 07.01.2014, 16:56 +0800 schrieb Wei Yongjun:
> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
>
> In case of error, the function device_create_with_groups()
> 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 <yongjun_wei@...ndmicro.com.cn>
> ---
> drivers/misc/genwqe/card_dev.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c
> index 9b231bb..46fa2ca 100644
> --- a/drivers/misc/genwqe/card_dev.c
> +++ b/drivers/misc/genwqe/card_dev.c
> @@ -1378,8 +1378,8 @@ int genwqe_device_create(struct genwqe_dev *cd)
> genwqe_attribute_groups,
> GENWQE_DEVNAME "%u_card",
> cd->card_idx);
> - if (cd->dev == NULL) {
> - rc = -ENODEV;
> + if (IS_ERR(cd->dev)) {
> + rc = PTR_ERR(cd->dev);
> goto err_cdev;
> }
>
>
Thanks for finding this potential problem and proposing a fix.
Acked-by: Frank Haverkamp <haver@...ux.vnet.ibm.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists