MLK-16774 usb: gadget: utp: fix coverity CID 414727 issue
authorLi Jun <jun.li@nxp.com>
Tue, 7 Nov 2017 10:40:19 +0000 (18:40 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:39:12 +0000 (15:39 -0500)
CID 414727: Explicit null dereferenced (FORWARD_NULL)
var_deref_op: Dereferencing null pointer uud.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
drivers/usb/gadget/function/fsl_updater.c

index f2729cf..ff2ad3c 100644 (file)
@@ -446,6 +446,10 @@ static int utp_exec(struct fsg_dev *fsg,
                if (uud->data.flags & UTP_FLAG_REPORT_BUSY)
                        pr_info("\tBUSY\n");
 #endif
+       } else {
+               pr_err("UTP write list is empty.\n");
+               mutex_unlock(&ctx->lock);
+               return 0;
        }
        mutex_unlock(&ctx->lock);