From patchwork Fri Aug 25 08:18:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 9921347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A542A60349 for ; Fri, 25 Aug 2017 08:19:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9487226D05 for ; Fri, 25 Aug 2017 08:19:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 893E226E1A; Fri, 25 Aug 2017 08:19:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0C9926D05 for ; Fri, 25 Aug 2017 08:19:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754971AbdHYITb (ORCPT ); Fri, 25 Aug 2017 04:19:31 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:22539 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754967AbdHYIT3 (ORCPT ); Fri, 25 Aug 2017 04:19:29 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v7P8JK4k010773 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Aug 2017 08:19:20 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v7P8JKhE015623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Aug 2017 08:19:20 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v7P8JJOf017378; Fri, 25 Aug 2017 08:19:19 GMT Received: from mwanda (/41.202.241.62) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 25 Aug 2017 01:19:18 -0700 Date: Fri, 25 Aug 2017 11:18:39 +0300 From: Dan Carpenter To: Ram Amrani , Kalderon@mwanda.mail.wl.linuxfoundation.org, Michal Cc: Ariel Elior , Doug Ledford , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] RDMA/qedr: Missing error code in qedr_init_user_queue() Message-ID: <20170825081839.5ahvp6pehrhyyf2z@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170609 (1.8.3) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We should return -ENOMEM if the kzalloc() fails. We currently return success. Fixes: 69ad0e7fe845 ("RDMA/qedr: Add support for iWARP in user space") Signed-off-by: Dan Carpenter Acked-by: Michal Kalderon --- 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/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index 4e14a558734b..bce4f79370e6 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -821,8 +821,10 @@ static inline int qedr_init_user_queue(struct ib_ucontext *ib_ctx, FW_PAGE_SHIFT); } else { q->pbl_tbl = kzalloc(sizeof(*q->pbl_tbl), GFP_KERNEL); - if (!q->pbl_tbl) + if (!q->pbl_tbl) { + rc = -ENOMEM; goto err0; + } } return 0;