From: Sagi Grimberg Date: Fri, 14 Mar 2014 12:51:58 +0000 (+0100) Subject: IB/srp: Check ib_query_gid return value X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2088ca66f5e986c06dc1deb4e2f004218b652300;p=linux-beck.git IB/srp: Check ib_query_gid return value Detected by Coverity. Signed-off-by: Sagi Grimberg Signed-off-by: Bart Van Assche Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 529b6bcdca7a..890322637e2e 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2649,7 +2649,9 @@ static ssize_t srp_create_target(struct device *dev, if (ret) goto err_free_mem; - ib_query_gid(ibdev, host->port, 0, &target->path.sgid); + ret = ib_query_gid(ibdev, host->port, 0, &target->path.sgid); + if (ret) + goto err_free_mem; shost_printk(KERN_DEBUG, target->scsi_host, PFX "new target: id_ext %016llx ioc_guid %016llx pkey %04x "