summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorTony LIU <junjie.liu@freescale.com>2012-07-20 10:11:06 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:20:42 +0300
commitf54aa852ba4249a502d2bee43c42ed7b8accadc0 (patch)
treef28213acbf76d3742e46212ec2594412a645c71b /drivers/usb/gadget
parent86096e1134ee8e973866044971f7e47d7beaa10a (diff)
MLK-11483-2 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 <junjie.liu@freescale.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/function/fsl_updater.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/fsl_updater.c b/drivers/usb/gadget/function/fsl_updater.c
index 8b2b53515fbf..32415d5a009c 100644
--- a/drivers/usb/gadget/function/fsl_updater.c
+++ b/drivers/usb/gadget/function/fsl_updater.c
@@ -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;
}