From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BD09C433F5 for ; Fri, 10 Sep 2021 00:41:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 33C7F61108 for ; Fri, 10 Sep 2021 00:41:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229549AbhIJAmD (ORCPT ); Thu, 9 Sep 2021 20:42:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:43770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232123AbhIJASn (ORCPT ); Thu, 9 Sep 2021 20:18:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF51A610E9; Fri, 10 Sep 2021 00:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631233033; bh=oFz61alXTOW06JOhzSWsngaa9cI/LzWBSyT5PC3YZqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P0HfgsEzbX3mhEF6T5acNO+vZYafO6JAQ4kbD+PQRvEVHHTqCk4gMH8eWIFj+AXFu JsbRPzAW50RuJA06zf5szkFhLIU5wU4+5dQiefdYdUnniLWchh4QPVECzwrki5TqiR RFX0VDK4AkPC6/oCA4Xj5tR7GzYAqoXz1LwQ96eyQCB45PcZkQMW94xWk+vjtMkPNu Wu4+NucJb+k9Ec2ON0QShzWrPjb/bYJkYa0Bds3yAvM1R6gdy8QIpkD6gGfMZ0P+7l xK3cUkwsegy22jipTljhFGxl74umSxbOFtU5S/Z6O9SgTOh9qlBpLOWsQLD9URBa1I 5UdHKJZxI7M/g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Evgeny Novikov , Jiri Kosina , Sasha Levin , linux-input@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.14 54/99] HID: thrustmaster: Fix memory leak in remove Date: Thu, 9 Sep 2021 20:15:13 -0400 Message-Id: <20210910001558.173296-54-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210910001558.173296-1-sashal@kernel.org> References: <20210910001558.173296-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Evgeny Novikov [ Upstream commit df3a97bdbc252d3421f1c5d6d713ad6e4f36a469 ] thrustmaster_remove() does not release memory for tm_wheel->change_request. This is fixed by the patch. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-thrustmaster.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c index e94d3409fd10..9cb4248f95af 100644 --- a/drivers/hid/hid-thrustmaster.c +++ b/drivers/hid/hid-thrustmaster.c @@ -253,6 +253,7 @@ static void thrustmaster_remove(struct hid_device *hdev) usb_kill_urb(tm_wheel->urb); + kfree(tm_wheel->change_request); kfree(tm_wheel->response); kfree(tm_wheel->model_request); usb_free_urb(tm_wheel->urb); -- 2.30.2