From patchwork Wed Jun 5 02:17:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2664261 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id F3A71DF2A1 for ; Wed, 5 Jun 2013 02:17:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751951Ab3FECR4 (ORCPT ); Tue, 4 Jun 2013 22:17:56 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:58747 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751676Ab3FECRz (ORCPT ); Tue, 4 Jun 2013 22:17:55 -0400 Received: by mail-wi0-f174.google.com with SMTP id c10so4339746wiw.7 for ; Tue, 04 Jun 2013 19:17:54 -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=2vJzo6oDC9eIgjKqAPSJO90K97vzpSZNzijH/OJb6NQ=; b=Q6/4DygkqAZ8lUYVPXwTzK9vzeFWXA3Kw+AhNau/IJv/kAhA/3H3C7dbvetHaIDC57 VzodfA9ZRh76Pkieavtr7V6AXRdTYTvsOm6MeTdMdW8Qknb/SE8mPHL97Dvpr9eKEg7r dxuWieWY69OnAPeuV+6Oen0WlJMxAZ33e4wZ1pDd29RWxzaxlSx1IA1FLUJrdrMGIdzy 1IHkAQaFFKsO1kgS2gpUx4fpx0/TeyxzirkamSJMWktES1Sxn7anW/OhSRIl3N+2D5eW OFerXIkiZ7oSmtAYDoZIbDhLggezJr/TsdYx0t4htjB4aoaVhEKVKIoRSBDBPAJO+V9C Uihg== MIME-Version: 1.0 X-Received: by 10.194.93.74 with SMTP id cs10mr24024670wjb.9.1370398674493; Tue, 04 Jun 2013 19:17:54 -0700 (PDT) Received: by 10.194.103.38 with HTTP; Tue, 4 Jun 2013 19:17:54 -0700 (PDT) Date: Wed, 5 Jun 2013 10:17:54 +0800 Message-ID: Subject: [PATCH] ib_srpt: fix error return code in srpt_create_ch_ib() and srpt_cm_req_recv() From: Wei Yongjun To: roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com, nab@linux-iscsi.org, hch@lst.de, standby24x7@gmail.com, grundler@chromium.org 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 From: Wei Yongjun Fix to return a negative error code in some error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun --- drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +++ 1 file changed, 3 insertions(+) -- 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/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 3f3f041..1d9b019 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -2144,6 +2144,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) if (IS_ERR(ch->thread)) { printk(KERN_ERR "failed to create kernel thread %ld\n", PTR_ERR(ch->thread)); + ret = PTR_ERR(ch->thread); ch->thread = NULL; goto err_destroy_qp; } @@ -2589,6 +2590,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, " configured yet for initiator %s.\n", ch->sess_name); rej->reason = __constant_cpu_to_be32( SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED); + ret = -ENOENT; goto destroy_ib; } @@ -2597,6 +2599,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id, rej->reason = __constant_cpu_to_be32( SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES); pr_debug("Failed to create session\n"); + ret = PTR_ERR(ch->sess); goto deregister_session; } ch->sess->se_node_acl = &nacl->nacl;