From: Tony LIU Date: Fri, 20 Jul 2012 02:11:06 +0000 (+0800) Subject: ENGR00217717 mfgtool firmware will crash during mfgtool running X-Git-Tag: v3.0.35-fsl_4.1.0~880 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3eb8e61c4d95ae9243970fae4ecd1b947ea8c6fc;p=karo-tx-linux.git ENGR00217717 mfgtool firmware will crash during mfgtool running - 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 --- diff --git a/drivers/usb/gadget/fsl_updater.c b/drivers/usb/gadget/fsl_updater.c index 01b35f31cba7..39175d6d4c48 100644 --- a/drivers/usb/gadget/fsl_updater.c +++ b/drivers/usb/gadget/fsl_updater.c @@ -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; }