Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp7097779pxv; Fri, 30 Jul 2021 09:55:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytVl9FR1+acRTQedqJqY5KdNsTv+GKkClGRF8WHQakdKbuOYNxb6kgF5l72A44yclnA+lA X-Received: by 2002:a92:d3cb:: with SMTP id c11mr2665385ilh.178.1627664108252; Fri, 30 Jul 2021 09:55:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627664108; cv=none; d=google.com; s=arc-20160816; b=K0sCCP4CGoggAnEIZ851qMWnaKqFXyUEwXYxIKeQ0j91iFj2aNLc5YVcPzhOxDKUYT /30/4UrMQwWbRIHheu9AfMHsAnWUPnUKPBNen8NNPFNN8iR/Unw8KBSmuys7uuGYc70E QoyNQ3RpFWAUPnl3nz89xWNj2A5zmt0Qory6c3eSPh8dFZeOXK+/uKa4EGeo/v2GTJsD 9XafuXYZPX/h+a5MoT4hiUlmD4LTGxI6iMQqpCPgjdwvc6B1je7oiarF4cJNDdii6rRv RvD46eLACcxzwsYXj1gU7gZpgyFD+dSzj9stXSqKueSjbzJ2PZpXYanj3KgXRbZZBrh9 nHsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Pzs1lXp4mcvVgOPYtM8LF6EdQ02S6PY1GxcvpUyLMWE=; b=EJ2hJ7a8dpVTbuOPsO83BUNY1UPGVTUImYw2DYOpaQjGNPLNvQCRe9LPwtd53bBU1+ 0BFRyCx+icFB/fX2RCRyHcQwG5rOkj9W3z4YozDhcuVFQwysMevdxRdfvGpAJ1wN3WTq CDIgWj1shd1/5yxlmUmUdHqyPKNUDYcNv6seLUr0z6zgIn73afAFrfYHnk7+cwbJec71 uIDn8zFDThv1yVHQJcsYcauGvuobmf0GWXEjPEppJs5KPJ9lwboKAXB+NMsVIMZf0WlH WI/s2X9GqRIqGKqzdUw6/OwNmykciEke2i1caBsYCBu0mlmR3MToXpODcTN9XJh8LdAN Dezg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a9si2568124ilr.103.2021.07.30.09.54.56; Fri, 30 Jul 2021 09:55:08 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbhG3Qxl (ORCPT + 99 others); Fri, 30 Jul 2021 12:53:41 -0400 Received: from mail.ispras.ru ([83.149.199.84]:41052 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229761AbhG3Qxk (ORCPT ); Fri, 30 Jul 2021 12:53:40 -0400 Received: from hellwig.intra.ispras.ru (unknown [83.149.199.249]) by mail.ispras.ru (Postfix) with ESMTPS id 9A6A040755E7; Fri, 30 Jul 2021 16:53:34 +0000 (UTC) From: Evgeny Novikov To: Jiri Kosina Cc: Evgeny Novikov , Benjamin Tissoires , Maxime Coquelin , Alexandre Torgue , linux-input@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH 3/3] HID: thrustmaster: Fix memory leak in thrustmaster_interrupts() Date: Fri, 30 Jul 2021 19:53:33 +0300 Message-Id: <20210730165333.25395-1-novikov@ispras.ru> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org thrustmaster_interrupts() does not free memory for send_buf when usb_interrupt_msg() fails. This is fixed by the given patch. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov --- 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 9cb4248f95af..d44550aa8805 100644 --- a/drivers/hid/hid-thrustmaster.c +++ b/drivers/hid/hid-thrustmaster.c @@ -173,6 +173,7 @@ static void thrustmaster_interrupts(struct hid_device *hdev) if (ret) { hid_err(hdev, "setup data couldn't be sent\n"); + kfree(send_buf); return; } } -- 2.26.2