diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-08-20 23:28:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-05 19:52:08 -0400 |
commit | 67990472c77b06cc591dd59923542f64da91453d (patch) | |
tree | 6505199543a8a2ecfc0a99b5899998fc469e3013 /drivers/usb/serial/mos7720.c | |
parent | 697d5c004e390102efbf9320a5416873679bea81 (diff) |
USB: mos7720: fix to use list_for_each_entry_safe() when delete items
Since we will be removing items off the list using list_del() we need
to use a safer version of the list_for_each_entry() macro aptly named
list_for_each_entry_safe(). We should use the safe macro if the loop
involves deletions of items.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/mos7720.c')
-rw-r--r-- | drivers/usb/serial/mos7720.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index a07dd3c8cfef..9817d9d654c1 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -281,7 +281,7 @@ static void send_deferred_urbs(unsigned long _mos_parport) | |||
281 | int ret_val; | 281 | int ret_val; |
282 | unsigned long flags; | 282 | unsigned long flags; |
283 | struct mos7715_parport *mos_parport = (void *)_mos_parport; | 283 | struct mos7715_parport *mos_parport = (void *)_mos_parport; |
284 | struct urbtracker *urbtrack; | 284 | struct urbtracker *urbtrack, *tmp; |
285 | struct list_head *cursor, *next; | 285 | struct list_head *cursor, *next; |
286 | 286 | ||
287 | /* if release function ran, game over */ | 287 | /* if release function ran, game over */ |
@@ -312,7 +312,7 @@ static void send_deferred_urbs(unsigned long _mos_parport) | |||
312 | /* move contents of deferred_urbs list to active_urbs list and submit */ | 312 | /* move contents of deferred_urbs list to active_urbs list and submit */ |
313 | list_for_each_safe(cursor, next, &mos_parport->deferred_urbs) | 313 | list_for_each_safe(cursor, next, &mos_parport->deferred_urbs) |
314 | list_move_tail(cursor, &mos_parport->active_urbs); | 314 | list_move_tail(cursor, &mos_parport->active_urbs); |
315 | list_for_each_entry(urbtrack, &mos_parport->active_urbs, | 315 | list_for_each_entry_safe(urbtrack, tmp, &mos_parport->active_urbs, |
316 | urblist_entry) { | 316 | urblist_entry) { |
317 | ret_val = usb_submit_urb(urbtrack->urb, GFP_ATOMIC); | 317 | ret_val = usb_submit_urb(urbtrack->urb, GFP_ATOMIC); |
318 | dbg("%s: urb submitted", __func__); | 318 | dbg("%s: urb submitted", __func__); |