Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753859AbdFSPcK (ORCPT ); Mon, 19 Jun 2017 11:32:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44018 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751971AbdFSPcI (ORCPT ); Mon, 19 Jun 2017 11:32:08 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maximilian Schneider , Marc Kleine-Budde Subject: [PATCH 4.4 02/30] can: gs_usb: fix memory leak in gs_cmd_reset() Date: Mon, 19 Jun 2017 23:20:36 +0800 Message-Id: <20170619152033.339619844@linuxfoundation.org> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170619152033.211450261@linuxfoundation.org> References: <20170619152033.211450261@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 776 Lines: 31 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marc Kleine-Budde commit 5cda3ee5138e91ac369ed9d0b55eab0dab077686 upstream. This patch adds the missing kfree() in gs_cmd_reset() to free the memory that is not used anymore after usb_control_msg(). Cc: Maximilian Schneider Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/usb/gs_usb.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -246,6 +246,8 @@ static int gs_cmd_reset(struct gs_usb *g sizeof(*dm), 1000); + kfree(dm); + return rc; }