Skip to content

Commit

Permalink
crypto: qat - Fix return value check in adf_chr_drv_create()
Browse files Browse the repository at this point in the history
In case of error, the function device_create() 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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Wei Yongjun authored and herbertx committed Aug 25, 2014
1 parent e5ffbfc commit 65fafbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/crypto/qat/qat_common/adf_ctl_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static int adf_chr_drv_create(void)
drv_device = device_create(adt_ctl_drv.drv_class, NULL,
MKDEV(adt_ctl_drv.major, 0),
NULL, DEVICE_NAME);
if (!drv_device) {
if (IS_ERR(drv_device)) {
pr_err("QAT: failed to create device\n");
goto err_cdev_del;
}
Expand Down

0 comments on commit 65fafbe

Please sign in to comment.