drm_rmmap_ioctl(): remove dead code
[safe/jmp/linux-2.6] / drivers / char / rocket.c
index a3fd7e7..56cbba7 100644 (file)
@@ -635,12 +635,11 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
        ctlp = sCtlNumToCtlPtr(board);
 
        /*  Get a r_port struct for the port, fill it in and save it globally, indexed by line number */
-       info = kmalloc(sizeof (struct r_port), GFP_KERNEL);
+       info = kzalloc(sizeof (struct r_port), GFP_KERNEL);
        if (!info) {
                printk(KERN_INFO "Couldn't allocate info struct for line #%d\n", line);
                return;
        }
-       memset(info, 0, sizeof (struct r_port));
 
        info->magic = RPORT_MAGIC;
        info->line = line;
@@ -1702,7 +1701,8 @@ static int rp_write(struct tty_struct *tty,
        if (count <= 0 || rocket_paranoia_check(info, "rp_write"))
                return 0;
 
-       mutex_lock_interruptible(&info->write_mtx);
+       if (mutex_lock_interruptible(&info->write_mtx))
+               return -ERESTARTSYS;
 
 #ifdef ROCKET_DEBUG_WRITE
        printk(KERN_INFO "rp_write %d chars...", count);