From patchwork Mon Feb 24 14:30:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 3709551 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5AE349F2ED for ; Mon, 24 Feb 2014 14:30:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E06A32015A for ; Mon, 24 Feb 2014 14:30:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A4BC20120 for ; Mon, 24 Feb 2014 14:30:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752928AbaBXOa2 (ORCPT ); Mon, 24 Feb 2014 09:30:28 -0500 Received: from mailp.voltaire.com ([193.47.165.129]:46999 "EHLO mellanox.co.il" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752880AbaBXOaZ (ORCPT ); Mon, 24 Feb 2014 09:30:25 -0500 Received: from Internal Mail-Server by MTLPINE2 (envelope-from sagig@mellanox.com) with SMTP; 24 Feb 2014 16:30:20 +0200 Received: from r-vnc02.mtr.labs.mlnx (r-vnc02.mtr.labs.mlnx [172.30.0.127]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id s1OEUKIB028287; Mon, 24 Feb 2014 16:30:20 +0200 Received: from r-vnc02.mtr.labs.mlnx (r-vnc02 [127.0.0.1]) by r-vnc02.mtr.labs.mlnx (8.14.4/8.14.4) with ESMTP id s1OEUKK3030676; Mon, 24 Feb 2014 16:30:20 +0200 Received: (from sagig@localhost) by r-vnc02.mtr.labs.mlnx (8.14.4/8.14.4/Submit) id s1OEUKFP030674; Mon, 24 Feb 2014 16:30:20 +0200 From: Sagi Grimberg To: bvanassche@acm.org Cc: roland@kernel.org, oren@mellanox.com, linux-rdma@vger.kernel.org Subject: [PATCH v1 2/3] IB/srp: Check ib_query_gid return value Date: Mon, 24 Feb 2014 16:30:17 +0200 Message-Id: <1393252218-30638-3-git-send-email-sagig@mellanox.com> X-Mailer: git-send-email 1.7.8.2 In-Reply-To: <1393252218-30638-1-git-send-email-sagig@mellanox.com> References: <1393252218-30638-1-git-send-email-sagig@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Detected by Coverity. Signed-off-by: Sagi Grimberg Acked-by: Bart Van Assche --- 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 "