From 634608f27acd098b245ca6fe60e06701185eb170 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Tue, 7 Jan 2014 16:56:35 +0800 Subject: 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 Acked-by: Frank Haverkamp Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c index 91a1c15..8f8a6b3 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) 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; } -- cgit v0.10.2