aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ Freyensee <james_p_freyensee@linux.intel.com>2010-12-08 10:57:43 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-08 10:57:43 +0000
commitb4718e4b7030a0956e9506f581e959e15bde1b91 (patch)
tree3b973cd7200abbb1b0e79c6e0b8fe73a0245f1dd
parentc34af3f5d45393b4158a413f82d61de0c957bca2 (diff)
downloadmrst-s0i3-test-b4718e4b7030a0956e9506f581e959e15bde1b91.tar.gz
mrst-s0i3-test-b4718e4b7030a0956e9506f581e959e15bde1b91.tar.xz
mrst-s0i3-test-b4718e4b7030a0956e9506f581e959e15bde1b91.zip
pti: kfree memory leak error
This patch fixes a bug in which one of the getID() corner cases does not deallocate memory. Signed-off-by: J Freyensee <james_p_freyensee@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com>
-rw-r--r--drivers/misc/pti.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index 691fa2f48e9..c8df8e918aa 100644
--- a/drivers/misc/pti.c
+++ b/drivers/misc/pti.c
@@ -234,7 +234,10 @@ static struct masterchannel *getID(u8 *IDarray, int max_IDS, int baseID)
if (IDarray[i] != 0xff)
break;
if (i == max_IDS)
+ {
+ kfree(mc);
return 0;
+ }
/* find the bit */
mask = 0x80;
for (j = 0; j < 8; j++) {