mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 21:24:08 +08:00
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>
This commit is contained in:
parent
3c1547e774
commit
634608f27a
@ -1306,8 +1306,8 @@ int genwqe_device_create(struct genwqe_dev *cd)
|
|||||||
genwqe_attribute_groups,
|
genwqe_attribute_groups,
|
||||||
GENWQE_DEVNAME "%u_card",
|
GENWQE_DEVNAME "%u_card",
|
||||||
cd->card_idx);
|
cd->card_idx);
|
||||||
if (cd->dev == NULL) {
|
if (IS_ERR(cd->dev)) {
|
||||||
rc = -ENODEV;
|
rc = PTR_ERR(cd->dev);
|
||||||
goto err_cdev;
|
goto err_cdev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user