From patchwork Tue Oct 29 01:56:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3105951 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 5C4869F431 for ; Tue, 29 Oct 2013 01:56:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F1A5201C0 for ; Tue, 29 Oct 2013 01:56:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83C212018E for ; Tue, 29 Oct 2013 01:56:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756767Ab3J2B4g (ORCPT ); Mon, 28 Oct 2013 21:56:36 -0400 Received: from mail-bk0-f49.google.com ([209.85.214.49]:50765 "EHLO mail-bk0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756651Ab3J2B4g (ORCPT ); Mon, 28 Oct 2013 21:56:36 -0400 Received: by mail-bk0-f49.google.com with SMTP id w14so2072438bkz.8 for ; Mon, 28 Oct 2013 18:56:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=5BXzw7mHcEonlbNunfEfikCho1XJ5s3Om1c5otECkTg=; b=oekFHTlsyemkEfmhRTarmzfo99C2ThQgV7weYZd7qrvpXCGGFz+zeWtvuaByCG7Q83 76IwsQvP12bqN339dXD0/uIznRox7Ovne2rOi0PqAC9iRM3XuaB8DrsUbcP2LaG4aGy7 Zd/fiVFN+5Ch9QAR53gTtqSzAzXgchgez70UJJWrUryQdWQtein5skRfIkjwq/KqqqdO KVYEjr144SDxHfapu9lRISg2/sR0T3JRgHZaw/9CuT6tFAu4tD2wwkfTN+EZ9B5mlRWh xy3cwW3JVmISF353R8xlcvAR6xzgrgyIPkmh2GaBKXvEt/N2pwyRLAarZ0ENC5LQINko G1yw== MIME-Version: 1.0 X-Received: by 10.205.3.7 with SMTP id nw7mr8833536bkb.26.1383011794666; Mon, 28 Oct 2013 18:56:34 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Mon, 28 Oct 2013 18:56:34 -0700 (PDT) Date: Tue, 29 Oct 2013 09:56:34 +0800 Message-ID: Subject: [PATCH] iser-target: fix error return code in isert_create_device_ib_res() From: Wei Yongjun To: roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com, nab@linux-iscsi.org, vu@mellanox.com, sagig@mellanox.com, ogerlitz@mellanox.com, jkosina@suse.cz Cc: yongjun_wei@trendmicro.com.cn, linux-rdma@vger.kernel.org Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Wei Yongjun Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/infiniband/ulp/isert/ib_isert.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) -- 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/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 6df2350..2ba71c0 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -263,21 +263,29 @@ isert_create_device_ib_res(struct isert_device *device) isert_cq_event_callback, (void *)&cq_desc[i], ISER_MAX_RX_CQ_LEN, i); - if (IS_ERR(device->dev_rx_cq[i])) + if (IS_ERR(device->dev_rx_cq[i])) { + ret = PTR_ERR(device->dev_rx_cq[i]); + device->dev_rx_cq[i] = NULL; goto out_cq; + } device->dev_tx_cq[i] = ib_create_cq(device->ib_device, isert_cq_tx_callback, isert_cq_event_callback, (void *)&cq_desc[i], ISER_MAX_TX_CQ_LEN, i); - if (IS_ERR(device->dev_tx_cq[i])) + if (IS_ERR(device->dev_tx_cq[i])) { + ret = PTR_ERR(device->dev_tx_cq[i]); + device->dev_tx_cq[i] = NULL; goto out_cq; + } - if (ib_req_notify_cq(device->dev_rx_cq[i], IB_CQ_NEXT_COMP)) + ret = ib_req_notify_cq(device->dev_rx_cq[i], IB_CQ_NEXT_COMP); + if (ret) goto out_cq; - if (ib_req_notify_cq(device->dev_tx_cq[i], IB_CQ_NEXT_COMP)) + ret = ib_req_notify_cq(device->dev_tx_cq[i], IB_CQ_NEXT_COMP); + if (ret) goto out_cq; }