Received: by 10.192.165.148 with SMTP id m20csp555457imm; Wed, 25 Apr 2018 04:11:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx48uO9jhqAlan4/lRwNheW2MIr/fFBWrp/paZieV7mhmkws0nSZ4OXnKgqNcRf8EEzwrcUo/ X-Received: by 10.101.71.132 with SMTP id e4mr20219044pgs.196.1524654705496; Wed, 25 Apr 2018 04:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524654705; cv=none; d=google.com; s=arc-20160816; b=VVAnt+FdxOXPmMPkcrpGVROVMmL/WFkeukulDPB30w6EgK9z1naUW9t/0OkXLUHQ6m TZists4sVYsoSdw5sx9sfiDYgwPVq7VPnneaPtpo8ZiJRhnGy0vDmG6AK9GmcpA+OlD8 Q/BE4hhLSKCwKZ+kbmzPxeetxUiP9E4d78HqGAc4+EeueSbtmCQYc5eF40Wfqzfmr22a RkagyxkqFUg42Qz5VFhd6ZYP4ULoVo0+3tx4Ct9itTsQHn1V15NFW4A2z1yhc92b0cJe Y5/1qRx3RrSAqC7431q62ZQ+iugR16k6K7GOoujcw6I/f++vDXnRJu6HumSQTlZvyKQc oH6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=TGb4m7NSxGvQgDZ/GuDfMzo+8Bas+bPtvke/tpAIfHM=; b=OUWOr0iueGff4mSwM6fYMLsKEhgGITNhvBaFlYU6wO0BcRTgUMTiI7uLPniDswZwsZ EDHKttQG4kzxyQM9cDUjGV8o5f31MSuDwAzJCLC8+cUE+/u+gPbcy338MW4zngdU1tXK IlrK5AUHVpPs38AesJMI60YQF0XCPBFHyx0QB+6ozk+6VjevkBbof5BPDjSqgSBO5T7W R85jG0HNBwiKFmjWWupEIj56rMikASVdUvuG6OWu2VJ7NOOfrD0ohqfDPz+0LESI3m1Y KzxZVPb+lP6KRBsDIfCKvZE8buC3EG/c+iJu6cTd4WwoktOPZIQKTTBBk5vYOVHeMr9x ou/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si9409665pgq.154.2018.04.25.04.11.31; Wed, 25 Apr 2018 04:11:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752841AbeDYLK3 (ORCPT + 99 others); Wed, 25 Apr 2018 07:10:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52308 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753415AbeDYKlM (ORCPT ); Wed, 25 Apr 2018 06:41:12 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DBD2E36; Wed, 25 Apr 2018 10:41:11 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Majd Dibbiny , Leon Romanovsky , Yuval Shaia , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 099/183] RDMA/mlx5: Avoid memory leak in case of XRCD dealloc failure Date: Wed, 25 Apr 2018 12:35:19 +0200 Message-Id: <20180425103246.447254626@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Leon Romanovsky [ Upstream commit b081808a66345ba725b77ecd8d759bee874cd937 ] Failure in XRCD FW deallocation command leaves memory leaked and returns error to the user which he can't do anything about it. This patch changes behavior to always free memory and always return success to the user. Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Reviewed-by: Yuval Shaia Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/mlx5/qp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -4636,13 +4636,10 @@ int mlx5_ib_dealloc_xrcd(struct ib_xrcd int err; err = mlx5_core_xrcd_dealloc(dev->mdev, xrcdn); - if (err) { + if (err) mlx5_ib_warn(dev, "failed to dealloc xrcdn 0x%x\n", xrcdn); - return err; - } kfree(xrcd); - return 0; }