From: Pontus Fuchs Date: Thu, 16 Jan 2014 14:00:40 +0000 (+0100) Subject: nl80211: Reset split_start when netlink skb is exhausted X-Git-Tag: submit/tizen_common/20140905.094502~700 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d87e47c32aad947e6ce5d3eb3ca077cabb0387b7;p=sdk%2Femulator%2Femulator-kernel.git nl80211: Reset split_start when netlink skb is exhausted commit f12cb2893069495726c21a4b0178705dacfecfe0 upstream. When the netlink skb is exhausted split_start is left set. In the subsequent retry, with a larger buffer, the dump is continued from the failing point instead of from the beginning. This was causing my rt28xx based USB dongle to now show up when running "iw list" with an old iw version without split dump support. Fixes: 3713b4e364ef ("nl80211: allow splitting wiphy information in dumps") Signed-off-by: Pontus Fuchs [avoid the entire workaround when state->split is set] Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 626dc3b5fd8d..c2853bbf8059 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -1655,9 +1655,10 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) * We can then retry with the larger buffer. */ if ((ret == -ENOBUFS || ret == -EMSGSIZE) && - !skb->len && + !skb->len && !state->split && cb->min_dump_alloc < 4096) { cb->min_dump_alloc = 4096; + state->split_start = 0; rtnl_unlock(); return 1; }