From: Jiri Kosina Date: Tue, 20 Nov 2012 16:09:40 +0000 (+0100) Subject: HID: i2c-hid: fix memory leak during probe X-Git-Tag: v3.12-rc1~1797^2^3~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c62602434c13744df62b3ab0ab7950cd36f24db;p=kernel%2Fkernel-generic.git HID: i2c-hid: fix memory leak during probe 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(). Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina --- 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; }