From patchwork Sun Jan 2 21:17:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Juhl X-Patchwork-Id: 446581 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p02LHIbu012729 for ; Sun, 2 Jan 2011 21:17:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750892Ab1ABVRB (ORCPT ); Sun, 2 Jan 2011 16:17:01 -0500 Received: from swampdragon.chaosbits.net ([90.184.90.115]:11154 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750834Ab1ABVRB (ORCPT ); Sun, 2 Jan 2011 16:17:01 -0500 Received: by swampdragon.chaosbits.net (Postfix, from userid 1000) id 4E6049403D; Sun, 2 Jan 2011 22:17:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by swampdragon.chaosbits.net (Postfix) with ESMTP id 46D1D9403B; Sun, 2 Jan 2011 22:17:00 +0100 (CET) Date: Sun, 2 Jan 2011 22:17:00 +0100 (CET) From: Jesper Juhl To: linux-input@vger.kernel.org cc: Jiri Kosina , linux-kernel@vger.kernel.org, =?ISO-8859-15?Q?Bruno_Pr=E9mont?= , "Rick L. Vinyard, Jr." Subject: [PATCH] HID, hid-picolcd: Fix memory leak in picolcd_debug_out_report() Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 02 Jan 2011 21:17:19 +0000 (UTC) diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c index bc2e077..ad6539a 100644 --- a/drivers/hid/hid-picolcd.c +++ b/drivers/hid/hid-picolcd.c @@ -1867,6 +1867,7 @@ static void picolcd_debug_out_report(struct picolcd_data *data, report->id, raw_size); hid_debug_event(hdev, buff); if (raw_size + 5 > sizeof(raw_data)) { + kfree(buff); hid_debug_event(hdev, " TOO BIG\n"); return; } else {