lkml.org 
[lkml]   [2012]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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().

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
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


\
 
 \ /
  Last update: 2012-11-21 05:21    [W:0.037 / U:1.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site