ENGR00161643-3 UTP : bugfix
authorHuang Shijie <b32955@freescale.com>
Tue, 8 Nov 2011 09:39:35 +0000 (17:39 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Thu, 12 Mar 2015 13:17:03 +0000 (14:17 +0100)
The origin code lossed one line.
fix it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/usb/gadget/fsl_updater.c

index 83333d1..83dcd56 100644 (file)
@@ -134,6 +134,7 @@ static ssize_t utp_file_write(struct file *file, const char __user *buf,
        if (size < sizeof(uud->data))
                return -EINVAL;
        uud = utp_user_data_alloc(size);
+       if (uud == NULL)
                return -ENOMEM;
        if (copy_from_user(&uud->data, buf, size)) {
                printk(KERN_INFO "[ %s ] copy error!\n", __func__);