Added a check to the return value of ib_get_cached_gid
before using the value that it set (becasue this function may fail).
Signed-off-by: Dotan Barak <[EMAIL PROTECTED]>
---
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c
b/drivers/infiniband/ulp/srp/ib_srp.c
index 950228f..fcefa50 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1812,7 +1812,9 @@ static ssize_t srp_create_target(struct class_device
*class_dev,
if (ret)
goto err;
- ib_get_cached_gid(host->dev->dev, host->port, 0, &target->path.sgid);
+ ret = ib_get_cached_gid(host->dev->dev, host->port, 0,
&target->path.sgid);
+ if (ret)
+ goto err;
printk(KERN_DEBUG PFX "new target: id_ext %016llx ioc_guid %016llx pkey
%04x "
"service_id %016llx dgid
%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general