Skip to content

Commit

Permalink
sbp-target: fix return value check in sbp_register_configfs()
Browse files Browse the repository at this point in the history
In case of error, the function target_fabric_configfs_init() returns
ERR_PTR() not NULL pointer. The NULL test in the return value check
should be replaced with IS_ERR().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Wei Yongjun authored and Nicholas Bellinger committed Sep 22, 2012
1 parent e4b11b8 commit b659f4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/target/sbp/sbp_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -2543,9 +2543,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;
Expand Down

0 comments on commit b659f4b

Please sign in to comment.