1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-14 23:50:37 +02:00
openwrt-xburst/package/broadcom-wl/patches/003-compat-2.6.35.patch
nbd f359241ffe broadcom-wl: fix uninitialized variable
It was causing an occasional kernel oops.

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26948 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-05-19 10:07:57 +00:00

40 lines
1.1 KiB
Diff

--- a/driver/wl_linux.c
+++ b/driver/wl_linux.c
@@ -2082,7 +2082,11 @@ static void
_wl_set_multicast_list(struct net_device *dev)
{
wl_info_t *wl;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34)
struct dev_mc_list *mclist;
+#else
+ struct netdev_hw_addr *ha;
+#endif
int i;
if (!dev)
@@ -2098,14 +2102,24 @@ _wl_set_multicast_list(struct net_device
wl->pub->allmulti = (dev->flags & IFF_ALLMULTI)? TRUE: FALSE;
/* copy the list of multicasts into our private table */
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34)
for (i = 0, mclist = dev->mc_list; mclist && (i < dev->mc_count);
i++, mclist = mclist->next) {
+#else
+ i = 0;
+ netdev_for_each_mc_addr(ha, dev) {
+#endif
if (i >= MAXMULTILIST) {
wl->pub->allmulti = TRUE;
i = 0;
break;
}
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34)
wl->pub->multicast[i] = *((struct ether_addr*) mclist->dmi_addr);
+#else
+ wl->pub->multicast[i] = *((struct ether_addr*) ha->addr);
+ i++;
+#endif
}
wl->pub->nmulticast = i;
wlc_set(wl->wlc, WLC_SET_PROMISC, (dev->flags & IFF_PROMISC));