orinoco: Maintain lock until entry removed from list
authorJoe Gunn <armadefuego@yahoo.com>
Tue, 15 Mar 2011 15:41:19 +0000 (08:41 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 21 Mar 2011 19:18:34 +0000 (15:18 -0400)
Removing an entry from the scan_list should be performed while holding
the lock.

Signed-off-by: Joseph J. Gunn <armadefuego@yahoo.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/orinoco/main.c

index f3d396e7544b9d1d0f7848bc1cabb74bce75b8de..62c6b2b37dbe3027713f34fe3a5ae35ca2226273 100644 (file)
@@ -1376,13 +1376,13 @@ static void orinoco_process_scan_results(struct work_struct *work)
 
        spin_lock_irqsave(&priv->scan_lock, flags);
        list_for_each_entry_safe(sd, temp, &priv->scan_list, list) {
-               spin_unlock_irqrestore(&priv->scan_lock, flags);
 
                buf = sd->buf;
                len = sd->len;
                type = sd->type;
 
                list_del(&sd->list);
+               spin_unlock_irqrestore(&priv->scan_lock, flags);
                kfree(sd);
 
                if (len > 0) {