[24/67] rtl8180: avoid potential NULL deref in rtl8180_beacon_work

Greg KH
2010-08-12T00:08:21Z

From: John W. Linville <linville@tuxdriver.com>

commit 8f1d2d2be73a98c21e68fe2a26f633892d4abdd1 upstream.

ieee80211_beacon_get can return NULL...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
drivers/net/wireless/rtl818x/rtl8180_dev.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
@@ -688,6 +688,8 @@ void rtl8180_beacon_work(struct work_str

/* grab a fresh beacon */
skb = ieee80211_beacon_get(dev, vif);
+ if (!skb)
+ goto resched;

/*
* update beacon timestamp w/ TSF value