Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp667043ybg; Mon, 1 Jun 2020 11:11:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwv/ItSSif8SCvLhf7h2Zypny7STFRtxWHfWaMqpYx8jWNAk2PKLF4EWu75AMYBpWzPuwVj X-Received: by 2002:aa7:c6d1:: with SMTP id b17mr24023979eds.39.1591035069383; Mon, 01 Jun 2020 11:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591035069; cv=none; d=google.com; s=arc-20160816; b=iLWcq1eubyw2zxmPpMIBKbVn0AOt5eN1KdcL5Kx8s64qinLxqd8aYKmbEq6y78bAh0 w7Pha6Hxbx7y3r156pE40QHpkX1NxZT1rImEg6ensQhxftxCEFv+A8sdH2UDDqfze62V CffUXhL47+P0lnu04dX4Lgf9v0GSQ4n9ksOyBc1JgdHZy3CkTZA9J/5cJclizomiUHYh ItsDxJ+oNMG22rV2MmrUUHkFxKbhn8IvJeDAn+Czx2A/IFyAt/attfdIItK8cyAJKR+P ASWyeQhswgillEfQP0BGgUWEjTED7PoRbFZE4S9b2FzpuKLtNGf8268leQiY4Q75qhxp yiAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IiQEQNmI6RtBM/+5cLs1Dz3dUwHB0z5E5D6zj0qBBLU=; b=OyJyRlhTu5F1PMpPr8iBKEaqB9SajVE6Rmg3O9HQTivTq7XMCdpFJXmjt5wMUT2kFH O2glA6HZBFSBo3IYt1vLLAjVYZcN+hWESqWORLNndwlVL+wdHdtyoaUKAgrJ+A7GxeCa 7+VGs7RKXWY1fATWdOLPGzXUWODi+74MDvh88R5ibUvdJ1pVCulDaC56S5TgGz/Hocjn 8lY3VwTMm/xwk438YG9/ZUEu9nqzjphssxHnSXu8lIPwyLK4n8we+0d+C5b7GsxNOkq9 fbYgu4d8xPAESsgaIujBjyH/q8vefTXJd+SGrL8vMNXrv1ksAcVd4O9qrzjT+oXUPY7J RqMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GLdWq50x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gq24si146349ejb.55.2020.06.01.11.10.45; Mon, 01 Jun 2020 11:11:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GLdWq50x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730178AbgFASHo (ORCPT + 99 others); Mon, 1 Jun 2020 14:07:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:52882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729801AbgFASHF (ORCPT ); Mon, 1 Jun 2020 14:07:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3FC6D2068D; Mon, 1 Jun 2020 18:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034824; bh=OWscbb58LV3wYU2t0kpPZcQFKkJCIC9E+3xuGSvNeqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GLdWq50xnqdNmGMPcXMzHSlTvYWz8D8+/Gp8ttVE+2cTLL8laczVrMW8mHJ7IUVgW SmY7SftryYBYtPc74E9ELlpjd8wiDTGQiYqnZuuBXSujdCDeLpmyX/Ul3eypBqirs6 4FZaemNAFh5RHuDhwap/ji4ZvOzgsOFAbeTM9ILI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiushi Wu , "David S. Miller" Subject: [PATCH 5.4 030/142] net/mlx4_core: fix a memory leak bug. Date: Mon, 1 Jun 2020 19:53:08 +0200 Message-Id: <20200601174041.020658881@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174037.904070960@linuxfoundation.org> References: <20200601174037.904070960@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qiushi Wu commit febfd9d3c7f74063e8e630b15413ca91b567f963 upstream. In function mlx4_opreq_action(), pointer "mailbox" is not released, when mlx4_cmd_box() return and error, causing a memory leak bug. Fix this issue by going to "out" label, mlx4_free_cmd_mailbox() can free this pointer. Fixes: fe6f700d6cbb ("net/mlx4_core: Respond to operation request by firmware") Signed-off-by: Qiushi Wu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx4/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c @@ -2734,7 +2734,7 @@ void mlx4_opreq_action(struct work_struc if (err) { mlx4_err(dev, "Failed to retrieve required operation: %d\n", err); - return; + goto out; } MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET); MLX4_GET(token, outbox, GET_OP_REQ_TOKEN_OFFSET);