]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00217717 mfgtool firmware will crash during mfgtool running
authorTony LIU <junjie.liu@freescale.com>
Fri, 20 Jul 2012 02:11:06 +0000 (10:11 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:16:54 +0000 (21:16 -0600)
- the root cause of this issue is there is no protection for
  the resource which will be accessed by multiple thread

Signed-off-by: Tony LIU <junjie.liu@freescale.com>
drivers/usb/gadget/fsl_updater.c

index 8b2b53515fbf95fabdcd7cc33c559995cfb1d4d3..32415d5a009c0cf3b138d7e03cb3f7c21394de3d 100644 (file)
@@ -70,9 +70,11 @@ static u32 count_list(struct list_head *l)
        u32 count = 0;
        struct list_head *tmp;
 
+       mutex_lock(&utp_context.lock);
        list_for_each(tmp, l) {
                count++;
        }
+       mutex_unlock(&utp_context.lock);
 
        return count;
 }