From 7444113017b9d5394dc8c4bdf577f9567502417b Mon Sep 17 00:00:00 2001
From: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Date: Tue, 13 Oct 2009 12:47:53 +0300
Subject: [PATCH] wl1271: Fix multicast list handling

Fixes bugs in the multicast list handling:
 - Use atomic memory allocation in non-sleepable context
 - Increment address pointer when iterating list of MC addresses

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/wl12xx/wl1271_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index ae41a7095508..19dbdb1b38ab 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1160,7 +1160,7 @@ static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
 	 * configure_filter() instead of saving everything in the context.
 	 */
 
-	fp = kzalloc(sizeof(*fp), GFP_KERNEL);
+	fp = kzalloc(sizeof(*fp), GFP_ATOMIC);
 	if (!fp) {
 		wl1271_error("Out of memory setting filters.");
 		return 0;
@@ -1180,6 +1180,7 @@ static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
 			fp->mc_list_length++;
 		} else
 			wl1271_warning("Unknown mc address length.");
+		mc_list = mc_list->next;
 	}
 
 	/* FIXME: We still need to set our filters properly */
-- 
GitLab