From: J Freyensee <[email protected]>

This patch fixes a bug in which one of the getID() corner
cases does not deallocate memory.

Signed-off-by: J Freyensee <[email protected]>
---
 drivers/misc/pti.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index 691fa2f..c8df8e9 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++) {
-- 
1.6.6.1

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to