]> 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)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:12:27 +0000 (14:12 +0200)
- 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 01b35f31cba7ac724bc358a3482e8e62101496a6..39175d6d4c482982309b5bf315c74d8292ba48e4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Freescale UUT driver
  *
- * Copyright 2008-2011 Freescale Semiconductor, Inc.
+ * Copyright 2008-2012 Freescale Semiconductor, Inc.
  * Copyright 2008-2009 Embedded Alley Solutions, Inc All Rights Reserved.
  */
 
@@ -71,9 +71,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;
 }