From patchwork Tue Dec 11 10:26:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 10723423 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 636A21751 for ; Tue, 11 Dec 2018 10:27:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E74E2A392 for ; Tue, 11 Dec 2018 10:27:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FB662A2E4; Tue, 11 Dec 2018 10:27:02 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 E92582A2E4 for ; Tue, 11 Dec 2018 10:27:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbeLKK1B (ORCPT ); Tue, 11 Dec 2018 05:27:01 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:34926 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726134AbeLKK1B (ORCPT ); Tue, 11 Dec 2018 05:27:01 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBBAOJQR044325; Tue, 11 Dec 2018 10:26:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2018-07-02; bh=4wHU8+oYibN52k5jkcMP7IzZwFLkwcUE9VBltj4HmUg=; b=EVDpFSd+uS69gNOXbLr6xwZshBgvxRGxKLNWnr12qMDARHgXPfkPYor95f0UWCLFanGs kBuWe9HDlilwC4uZNDlIWJkjLABGMGTjrFhberzX8SpTXKFkxUWbspUGYxGMnUZS4Se7 tqS/DVUbz2SvtfX+Af+JSJp2rZKZMFqpCeRQfsAgiwifbV+TN6sFq4dkGh6C7H7Xzxk9 i4agKiSbhfWbEKVe7Fe79TXNPxmDGbr6OsSKvlutlXcMYwSRaLkRGPnudlkIyuNunfaF QDBLQbsKu2KiQvr6jvUNBMm812WPRvEPQLUjVakvzpVV2UO+zbFVcsAOduDsOAGWidV8 gw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2p85cu32y4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Dec 2018 10:26:55 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wBBAQomX003261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Dec 2018 10:26:50 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBBAQmn1022649; Tue, 11 Dec 2018 10:26:49 GMT Received: from lap1.nl.oracle.com (/10.175.38.85) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 11 Dec 2018 02:26:48 -0800 From: Yuval Shaia To: yishaih@mellanox.com, dledford@redhat.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org, bart.vanassche@sandisk.com Cc: Yuval Shaia Subject: [PATCH] IB/mlx4: Remove unneeded NULL check Date: Tue, 11 Dec 2018 12:26:35 +0200 Message-Id: <20181211102635.25208-1-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9103 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=919 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812110098 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 NULL check for kfree is unnecessary, remove it. Fixes: b42dde47 ("IB/mlx4: Rework special QP creation error path") Signed-off-by: Yuval Shaia Reviewed-by: Leon Romanovsky --- drivers/infiniband/hw/mlx4/qp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index fd95699cae35..651d8594dc3f 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -1211,10 +1211,10 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd, mlx4_db_free(dev->dev, &qp->db); err: - if (sqp) - kfree(sqp); - else if (!*caller_qp) + if (!sqp && !*caller_qp) kfree(qp); + kfree(sqp); + return err; }