Message ID | 1393252218-30638-3-git-send-email-sagig@mellanox.com (mailing list archive) |
---|---|
State | Rejected |
Headers | show |
On 02/24/14 15:30, Sagi Grimberg wrote: > Detected by Coverity. > > Signed-off-by: Sagi Grimberg <sagig@mellanox.com> > --- > drivers/infiniband/ulp/srp/ib_srp.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c > index 0e20bfb..b615135 100644 > --- a/drivers/infiniband/ulp/srp/ib_srp.c > +++ b/drivers/infiniband/ulp/srp/ib_srp.c > @@ -2652,7 +2652,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 " > This patch looks fine to me, so Acked-by: Bart Van Assche <bvanassche@acm.org> -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 0e20bfb..b615135 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2652,7 +2652,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 "
Detected by Coverity. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> --- drivers/infiniband/ulp/srp/ib_srp.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)