Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753955AbdFSPlo (ORCPT ); Mon, 19 Jun 2017 11:41:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44238 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752298AbdFSPdX (ORCPT ); Mon, 19 Jun 2017 11:33:23 -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 3.18 11/32] can: gs_usb: fix memory leak in gs_cmd_reset() Date: Mon, 19 Jun 2017 23:20:55 +0800 Message-Id: <20170619152036.272910256@linuxfoundation.org> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170619152035.750974520@linuxfoundation.org> References: <20170619152035.750974520@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: 777 Lines: 31 3.18-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; }