Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
[safe/jmp/linux-2.6] / drivers / telephony / ixj.c
index 41b6530..b53deee 100644 (file)
 #include <linux/fs.h>          /* everything... */
 #include <linux/errno.h>       /* error codes */
 #include <linux/slab.h>
+#include <linux/smp_lock.h>
 #include <linux/mm.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
@@ -2328,7 +2329,6 @@ static int ixj_release(struct inode *inode, struct file *file_p)
        j->rec_codec = j->play_codec = 0;
        j->rec_frame_size = j->play_frame_size = 0;
        j->flags.cidsent = j->flags.cidring = 0;
-       ixj_fasync(-1, file_p, 0);      /* remove from list of async notification */
 
        if(j->cardtype == QTI_LINEJACK && !j->readers && !j->writers) {
                ixj_set_port(j, PORT_PSTN);
@@ -4190,7 +4190,7 @@ static void ixj_aec_start(IXJ *j, int level)
                                ixj_WriteDSPCommand(0x1224, j);
 
                        ixj_WriteDSPCommand(0xE014, j);
-                       ixj_WriteDSPCommand(0x0003, j); /* Lock threashold at 3dB */
+                       ixj_WriteDSPCommand(0x0003, j); /* Lock threshold at 3dB */
 
                        ixj_WriteDSPCommand(0xE338, j); /* Set Echo Suppresser Attenuation to 0dB */
 
@@ -4235,7 +4235,7 @@ static void ixj_aec_start(IXJ *j, int level)
                                ixj_WriteDSPCommand(0x1224, j);
 
                        ixj_WriteDSPCommand(0xE014, j);
-                       ixj_WriteDSPCommand(0x0003, j); /* Lock threashold at 3dB */
+                       ixj_WriteDSPCommand(0x0003, j); /* Lock threshold at 3dB */
 
                        ixj_WriteDSPCommand(0xE338, j); /* Set Echo Suppresser Attenuation to 0dB */
 
@@ -5879,20 +5879,13 @@ out:
 static int ixj_build_filter_cadence(IXJ *j, IXJ_FILTER_CADENCE __user * cp)
 {
        IXJ_FILTER_CADENCE *lcp;
-       lcp = kmalloc(sizeof(IXJ_FILTER_CADENCE), GFP_KERNEL);
-       if (lcp == NULL) {
+       lcp = memdup_user(cp, sizeof(IXJ_FILTER_CADENCE));
+       if (IS_ERR(lcp)) {
                if(ixjdebug & 0x0001) {
-                       printk(KERN_INFO "Could not allocate memory for cadence\n");
+                       printk(KERN_INFO "Could not allocate memory for cadence or could not copy cadence to kernel\n");
                }
-               return -ENOMEM;
+               return PTR_ERR(lcp);
         }
-       if (copy_from_user(lcp, cp, sizeof(IXJ_FILTER_CADENCE))) {
-               if(ixjdebug & 0x0001) {
-                       printk(KERN_INFO "Could not copy cadence to kernel\n");
-               }
-               kfree(lcp);
-               return -EFAULT;
-       }
        if (lcp->filter > 5) {
                if(ixjdebug & 0x0001) {
                        printk(KERN_INFO "Cadence out of range\n");