From patchwork Fri Mar 15 09:42:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2275651 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AE15F3FC8F for ; Fri, 15 Mar 2013 09:42:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753928Ab3COJmR (ORCPT ); Fri, 15 Mar 2013 05:42:17 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:45602 "EHLO mail-bk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753693Ab3COJmR (ORCPT ); Fri, 15 Mar 2013 05:42:17 -0400 Received: by mail-bk0-f45.google.com with SMTP id i18so1421188bkv.32 for ; Fri, 15 Mar 2013 02:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=vrMLObLqSZ8rU6rEQf23fq14s7wwBFmZAeOr9aTEfNE=; b=ZwIEqdicFZkTTIH+PF99EYWOwI7fWiFlYJuL+hQ+1oBJm+Glue7Nz+MWOMG4qRBOI7 doamy0SZyhAb5R8FuzCSlxKQ7XZVa3Lzvf/WFC4DCluSYR2zjKHul98D5XspPqg4cR/w kRZTv5qORG4o7vxKo4Jd1SIMfGkS2JJELlK+Fo81lG0ggp8p63JC24M0jgTKjuS0j0K3 +nP42Gp8T/zaDEd/Eo+/yNMhnggJ1XngyikydelzndwAfkAHj5Ho/u2Gbem/OYGKr4c0 /qSsgQKZfkShV2pBThZjoP5/tQlqDBS77e+4snktByRYo8nCz1xcpUkO8CFTL7/LmJWk 4j/Q== MIME-Version: 1.0 X-Received: by 10.204.238.133 with SMTP id ks5mr2767744bkb.101.1363340533077; Fri, 15 Mar 2013 02:42:13 -0700 (PDT) Received: by 10.204.30.210 with HTTP; Fri, 15 Mar 2013 02:42:12 -0700 (PDT) Date: Fri, 15 Mar 2013 17:42:12 +0800 Message-ID: Subject: [PATCH -next] RDMA/cxgb4: fix error return code in create_qp() From: Wei Yongjun To: swise@chelsio.com, roland@kernel.org, sean.hefty@intel.com, hal.rosenstock@gmail.com 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 from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun Acked-by: Steve Wise --- drivers/infiniband/hw/cxgb4/qp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 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/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c index 9fe6f1e..5b059e2 100644 --- a/drivers/infiniband/hw/cxgb4/qp.c +++ b/drivers/infiniband/hw/cxgb4/qp.c @@ -194,8 +194,10 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, wq->rq.queue = dma_alloc_coherent(&(rdev->lldi.pdev->dev), wq->rq.memsize, &(wq->rq.dma_addr), GFP_KERNEL); - if (!wq->rq.queue) + if (!wq->rq.queue) { + ret = -ENOMEM; goto free_sq; + } PDBG("%s sq base va 0x%p pa 0x%llx rq base va 0x%p pa 0x%llx\n", __func__, wq->sq.queue, (unsigned long long)virt_to_phys(wq->sq.queue),