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>
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;
}