Received: by 10.192.165.156 with SMTP id m28csp46087imm; Tue, 10 Apr 2018 16:05:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+YcmjC5u6t3AyFUl5dY1Lahml82W07n//Is/ZQ5JbSY+c1jySS1quUTUx4/ig9Zc/DDDGE X-Received: by 10.101.70.132 with SMTP id h4mr1611658pgr.155.1523401506680; Tue, 10 Apr 2018 16:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523401506; cv=none; d=google.com; s=arc-20160816; b=dha+RzUiIfB5i0PK0KG/6msmDsalBqNqlRXxMaaAHzf+IpdG4tU0PcGjncxDSfXrsl G8Rr5ZDLoV0x646/THiwLqmmYlQOmUS6fbHFYzhGl6bwE3NNciJ6NNzFbDQpeAdpkAsg MDlBo5iLC7Q1GMioTf6oNxZFV/77sX0+uOGTcyNUIw4VLvF9E3XCaRg6waHZupwtS21c fj4sEmNnGnLXCeZqBpiGgfLLcyoDRUUr6h6fKCu+fc7j79kPVP6RUuWvJmQfFO3hcEir 8WUCtvsKM7nOqTMMSG2wKWEMRLfZhKPbpaFj6GuJaXTU32hBVPy0aJ6gJzT3bt/Ma5hm mClA== 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=QFmZxfZK+2x59kU4lw7XakKDDl8ToR+Dlk71uI7tSAM=; b=FXUBxJ5ltlamoZuvxR3HjYs8ulHxI9BPDiUsQj/O5QtTrbBpcjGPkvbrM8NpIcKvlc gYbxW9TBZxlNk70MPJXOG7k5RYh5+MFtzvlG/6MwkIe0FZbDWXPtcySjUzyDUoCKBh4B tsroxAFe7x1KWfVCUnoyQLaboLkAebu8zp0hHBS+BFse4vVrZ3JXofPOwlAaLU/ER7tN kGFEOZWnQF52/PMbxckxXYayjoRGyYwYfA+nhhSL1pKumKEgNxqT8b9fV5NzhUQeI1ja p7m37Ea2s5gtMw7XmQRkXOc91VAZU7yEDHJF6ymPLxzZ/YHM4fJpHCqvtYL4Jigj3ryF PjRQ== 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 11-v6si3535893plb.658.2018.04.10.16.04.30; Tue, 10 Apr 2018 16:05:06 -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 S1755900AbeDJW6c (ORCPT + 99 others); Tue, 10 Apr 2018 18:58:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42412 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755611AbeDJWgQ (ORCPT ); Tue, 10 Apr 2018 18:36:16 -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 9102EE00; Tue, 10 Apr 2018 22:36:15 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Yan , John Garry , chenqilin , chenxiang , Christoph Hellwig , Hannes Reinecke , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 060/138] scsi: libsas: fix memory leak in sas_smp_get_phy_events() Date: Wed, 11 Apr 2018 00:24:10 +0200 Message-Id: <20180410212909.058135026@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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: Jason Yan [ Upstream commit 4a491b1ab11ca0556d2fda1ff1301e862a2d44c4 ] We've got a memory leak with the following producer: while true; do cat /sys/class/sas_phy/phy-1:0:12/invalid_dword_count >/dev/null; done The buffer req is allocated and not freed after we return. Fix it. Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Signed-off-by: Jason Yan CC: John Garry CC: chenqilin CC: chenxiang Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/libsas/sas_expander.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -695,6 +695,7 @@ int sas_smp_get_phy_events(struct sas_ph phy->phy_reset_problem_count = scsi_to_u32(&resp[24]); out: + kfree(req); kfree(resp); return res;