From patchwork Tue Jan 30 20:40:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10192737 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 BACFE6020C for ; Tue, 30 Jan 2018 20:41:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA8892785D for ; Tue, 30 Jan 2018 20:41:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F3C927861; Tue, 30 Jan 2018 20:41:01 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 5C05427968 for ; Tue, 30 Jan 2018 20:41:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752800AbeA3Uk4 (ORCPT ); Tue, 30 Jan 2018 15:40:56 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:43262 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752266AbeA3Uky (ORCPT ); Tue, 30 Jan 2018 15:40:54 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0UKbvtC139350; Tue, 30 Jan 2018 20:40:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=52N9GwQXs+do9SO1gnEk0Ja61MLaDysv7NQqkBhhAcs=; b=LL0X5qvrDncWguRADT4DCxaQbD8u4AW05Qcgq/R26drWO6ykmugwyrlbMaI+N65uuAXc FnepJSyo3d26/GMgqoG+OWSWG0f8GA1sxMc5GZ+HOy4qFb6iBXmG9R5nxgvT39HKP+Gx yVww4MJTaDS2zyZqhSz9DKeMyTXRoLk4V39gZ2bcqNObyx3iRILSKuNso7Sdf6YOeBPb Fu6uRVXoIJj+q3NL6P1k28Z18pJEoJKsNPs2NNcgEcheC/6GBQQn2XBqS5B5eoBGPeS0 1agWayfqwYHWD1TfqMv/k4XHs7aHciUwzMpv4awm2Hu2HIKUrRYb4CAR0ZowNZvXz7ix vw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2ftw5d108x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Jan 2018 20:40:51 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0UKeoZ7000371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Jan 2018 20:40:50 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0UKenEZ018300; Tue, 30 Jan 2018 20:40:49 GMT Received: from mwanda (/197.157.34.178) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 30 Jan 2018 12:40:49 -0800 Date: Tue, 30 Jan 2018 23:40:30 +0300 From: Dan Carpenter To: Selvin Xavier , Devesh Sharma Cc: Somnath Kotur , Sriharsha Basavapatna , Doug Ledford , Jason Gunthorpe , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] RDMA/bnxt_re: Fix an error code in bnxt_qplib_create_srq() Message-ID: <20180130150434.GA13690@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.2 (2017-12-15) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8790 signatures=668657 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=507 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801300250 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 allocation fails. (The current code returns succees). Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters") Signed-off-by: Dan Carpenter Acked-By: Devesh Sharma --- 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/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index 8b5f11ac0e42..1b0e94697fe3 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -557,8 +557,10 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res, srq->swq = kcalloc(srq->hwq.max_elements, sizeof(*srq->swq), GFP_KERNEL); - if (!srq->swq) + if (!srq->swq) { + rc = -ENOMEM; goto fail; + } RCFW_CMD_PREP(req, CREATE_SRQ, cmd_flags);