]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
misc: genwqe: fix return value check in genwqe_device_create()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 7 Jan 2014 08:56:35 +0000 (16:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jan 2014 23:22:49 +0000 (15:22 -0800)
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@trendmicro.com.cn>
Acked-by: Frank Haverkamp <haver@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/genwqe/card_dev.c

index 91a1c151afbaa45d9728c008312376960aacfa15..8f8a6b327cdb83dd494823a77a50c98078738b38 100644 (file)
@@ -1306,8 +1306,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;
        }