From: J Freyensee <[email protected]>

This patch contains 3 random bug fixes:
1. PTI HW spec says 128 channels, not 256
2. memory leak bug
3. code eliminated that was flagged from an open-source code
review on a different driver.

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

diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index 9c31aef..71aa783 100644
--- a/drivers/misc/pti.c
+++ b/drivers/misc/pti.c
@@ -44,7 +44,7 @@
 #define PCINAME                "pciPTI"
 #define TTYNAME                "ttyPTI"
 #define CHARNAME       "pti"
-#define MAX_APP_IDS    256
+#define MAX_APP_IDS    128
 #define MAX_OS_IDS     128
 #define CONTROL_ID     72   /* control master ID address */
 #define CONSOLE_ID     73   /* console master ID address */
@@ -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++) {
@@ -854,13 +857,6 @@ static void __exit pti_exit(void)
 {
        int retval;
 
-       /* If some thead is hanging onto the alloclock, force it to release
-        * it because we are shutting down.
-        */
-       if (mutex_is_locked(&alloclock) == 1)
-               mutex_unlock(&alloclock);
-       mutex_destroy(&alloclock);
-
        retval = misc_deregister(&pti_char_driver);
        if (retval) {
                pr_err("%s(%d): CHAR unregistration failed of pti driver\n",
-- 
1.6.6.1

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

Reply via email to