diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2014-01-07 03:56:35 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-08 18:22:49 -0500 |
commit | 634608f27acd098b245ca6fe60e06701185eb170 (patch) | |
tree | 1206ecfe325c1d14167a2cd72e0ca5f02f713893 /drivers/misc | |
parent | 3c1547e774b7d8485b7a1b15bb5e558d595ffc03 (diff) |
misc: genwqe: fix return value check in genwqe_device_create()
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/genwqe/card_dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c index 91a1c151afba..8f8a6b327cdb 100644 --- a/drivers/misc/genwqe/card_dev.c +++ b/drivers/misc/genwqe/card_dev.c | |||
@@ -1306,8 +1306,8 @@ int genwqe_device_create(struct genwqe_dev *cd) | |||
1306 | genwqe_attribute_groups, | 1306 | genwqe_attribute_groups, |
1307 | GENWQE_DEVNAME "%u_card", | 1307 | GENWQE_DEVNAME "%u_card", |
1308 | cd->card_idx); | 1308 | cd->card_idx); |
1309 | if (cd->dev == NULL) { | 1309 | if (IS_ERR(cd->dev)) { |
1310 | rc = -ENODEV; | 1310 | rc = PTR_ERR(cd->dev); |
1311 | goto err_cdev; | 1311 | goto err_cdev; |
1312 | } | 1312 | } |
1313 | 1313 | ||