diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2011-11-04 14:27:32 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-02-03 12:07:00 -0500 |
commit | 3af336376f77859da84bb1156ef29d5337b316a9 (patch) | |
tree | 31e6e0efc8b66c2212f834aeaa041052febd5076 /drivers | |
parent | ebfded8c4b34caea450709ce467e67483fa4d8df (diff) |
IB/srpt: Fix ERR_PTR() vs. NULL checking confusion
transport_init_session() and target_fabric_configfs_init() don't
return NULL pointers, they only return ERR_PTRs or valid pointers.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/ulp/srpt/ib_srpt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 38ef61dbee0a..c125614ac256 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c | |||
@@ -2595,7 +2595,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, | |||
2595 | } | 2595 | } |
2596 | 2596 | ||
2597 | ch->sess = transport_init_session(); | 2597 | ch->sess = transport_init_session(); |
2598 | if (!ch->sess) { | 2598 | if (IS_ERR(ch->sess)) { |
2599 | rej->reason = __constant_cpu_to_be32( | 2599 | rej->reason = __constant_cpu_to_be32( |
2600 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); | 2600 | SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); |
2601 | pr_debug("Failed to create session\n"); | 2601 | pr_debug("Failed to create session\n"); |
@@ -4009,10 +4009,10 @@ static int __init srpt_init_module(void) | |||
4009 | goto out; | 4009 | goto out; |
4010 | } | 4010 | } |
4011 | 4011 | ||
4012 | ret = -ENODEV; | ||
4013 | srpt_target = target_fabric_configfs_init(THIS_MODULE, "srpt"); | 4012 | srpt_target = target_fabric_configfs_init(THIS_MODULE, "srpt"); |
4014 | if (!srpt_target) { | 4013 | if (IS_ERR(srpt_target)) { |
4015 | printk(KERN_ERR "couldn't register\n"); | 4014 | printk(KERN_ERR "couldn't register\n"); |
4015 | ret = PTR_ERR(srpt_target); | ||
4016 | goto out; | 4016 | goto out; |
4017 | } | 4017 | } |
4018 | 4018 | ||