sbp-target: checking for NULL instead of IS_ERR()
Subsystems (3)
PATCH 1/1 sbp-target: checking for NULL instead of IS_ERR()
target_fabric_configfs_init() never returns NULL, it only returns ERR_PTRs.
Signed-off-by Dan Carpenter <[email protected]>
drivers/target/sbp/sbp_target.c +2 -2
@@ -2559,9 +2559,9 @@ static int sbp_register_configfs(void)int ret; fabric =target_fabric_configfs_init (THIS_MODULE ,"sbp" ); -if (!fabric) { +if (IS_ERR (fabric)) {pr_err ("target_fabric_configfs_init() failed\n" ); -return -ENOMEM ; +return PTR_ERR (fabric); } fabric->tf_ops = sbp_ops;
Quoted 4 lines · Dan Carpenter
target_fabric_configfs_init()never returns NULL, it only returnsERR_PTRs.Signed-off-by Dan Carpenter <[email protected]>
Dan,
Thanks, good catch. I guess my code came from before the change and I never noticed.
Acked-by Chris Boot <[email protected]>
Signature · 2 lines
Chris Boot [email protected]
Nicholas A. Bellinger
AppliedQuoted 12 lines · Dan Carpenter
target_fabric_configfs_init()never returns NULL, it only returnsERR_PTRs.Signed-off-by Dan Carpenter <[email protected]>drivers/target/sbp/sbp_target.c +0
-0@@ -2559,9 +2559,9 @@ static int sbp_register_configfs(void)int ret;
drivers/target/sbp/sbp_target.c static int sbp_register_configfs(void)
Quoted 10 lines
drivers/target/sbp/sbp_target.c +2
-3fabric =target_fabric_configfs_init (THIS_MODULE ,"sbp" ); -if (!fabric) { +if (IS_ERR (fabric)) {pr_err ("target_fabric_configfs_init() failed\n" ); -return -ENOMEM ; +return PTR_ERR (fabric); } fabric->tf_ops = sbp_ops; --
Applied to lio-core. Thanks DanC!
--nab