]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/char/vmcp.c
[PATCH] s390: tape operation abortion leads to panic
[linux-2.6-omap-h63xx.git] / drivers / s390 / char / vmcp.c
index dfbbf235ca2b39dd5a15c0d89d184327ebe95e38..19762f3476aadd22289d4ddb4a44d82985465bf4 100644 (file)
@@ -103,8 +103,10 @@ vmcp_write(struct file *file, const char __user * buff, size_t count,
        }
        cmd[count] = '\0';
        session = (struct vmcp_session *)file->private_data;
-       if (down_interruptible(&session->mutex))
+       if (down_interruptible(&session->mutex)) {
+               kfree(cmd);
                return -ERESTARTSYS;
+       }
        if (!session->response)
                session->response = (char *)__get_free_pages(GFP_KERNEL
                                                | __GFP_REPEAT  | GFP_DMA,
@@ -115,9 +117,9 @@ vmcp_write(struct file *file, const char __user * buff, size_t count,
                return -ENOMEM;
        }
        debug_text_event(vmcp_debug, 1, cmd);
-       session->resp_size = cpcmd(cmd, session->response,
-                                  session->bufsize,
-                                  &session->resp_code);
+       session->resp_size = __cpcmd(cmd, session->response,
+                                    session->bufsize,
+                                    &session->resp_code);
        up(&session->mutex);
        kfree(cmd);
        *ppos = 0;              /* reset the file pointer after a command */
@@ -203,7 +205,7 @@ static int __init vmcp_init(void)
        else
                printk(KERN_WARNING
                       "z/VM CP interface not loaded. Could not register misc device.\n");
-       vmcp_debug = debug_register("vmcp", 0, 1, 240);
+       vmcp_debug = debug_register("vmcp", 1, 1, 240);
        debug_register_view(vmcp_debug, &debug_hex_ascii_view);
        return ret;
 }