Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753471Ab2KTQeI (ORCPT ); Tue, 20 Nov 2012 11:34:08 -0500 Received: from mail-qc0-f174.google.com ([209.85.216.174]:48383 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751856Ab2KTQeG (ORCPT ); Tue, 20 Nov 2012 11:34:06 -0500 MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 20 Nov 2012 17:34:04 +0100 Message-ID: Subject: Re: [PATCH] HID: i2c-hid: fix memory leak during probe From: Benjamin Tissoires To: Jiri Kosina Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1177 Lines: 37 On Tue, Nov 20, 2012 at 5:09 PM, Jiri Kosina wrote: > In case we are returning from i2c_hid_probe() through the 'err' or > err_mem_free labels, there is noone freeing the buffers allocated by > i2c_hid_alloc_buffers(). ouch... thanks Jiri I hope there are not so much others like this one :) Reviewed-by: Benjamin Tissoires > > Signed-off-by: Jiri Kosina > --- > drivers/hid/i2c-hid/i2c-hid.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c > index 11140bd..67ab5b7 100644 > --- a/drivers/hid/i2c-hid/i2c-hid.c > +++ b/drivers/hid/i2c-hid/i2c-hid.c > @@ -892,6 +892,7 @@ err: > if (ihid->irq) > free_irq(ihid->irq, ihid); > > + i2c_hid_free_buffers(ihid); > kfree(ihid); > return ret; > } > > -- > Jiri Kosina > SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/