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

From: Greg KH
Date: Wed Aug 11 2010 - 20:16:23 EST


2.6.35-stable review patch. If anyone has any objections, please let us know.

------------------

From: John W. Linville <linville@xxxxxxxxxxxxx>

commit 8f1d2d2be73a98c21e68fe2a26f633892d4abdd1 upstream.

ieee80211_beacon_get can return NULL...

Signed-off-by: John W. Linville <linville@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/