From: John W. Linville <[EMAIL PROTECTED]> __prism2_translate_scan uses kmalloc to dynamically allocates a buffer for holding some textual diagnostic output, and it does so while holding a spinlock. With CONFIG_DEBUG_SPINLOCK_SLEEP defined, this causes debug messages to appear in /var/log/messages.
This patch allocates the buffer as part of the local_info structure. Like __prism2_translate_scan, the buffer is conditionally included in the structure when PRISM2_NO_STATION_MODES is _not_ defined. Signed-off-by: John W. Linville <[EMAIL PROTECTED]> --- This should be applied to the 'upstream' branch of netdev-2.6. drivers/net/wireless/hostap/hostap_ioctl.c | 26 +++++++++++++------------- drivers/net/wireless/hostap/hostap_wlan.h | 4 ++++ 2 files changed, 17 insertions(+), 13 deletions(-) applies-to: 602d150c67d5b3fb7191626b9996706b3de85986 8de5fe017207499d2933416d07c729b51f961498 diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index 2617d70..95b3679 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c @@ -1808,7 +1808,6 @@ static char * __prism2_translate_scan(lo u8 *pos; u8 *ssid, *bssid; size_t ssid_len; - char *buf; if (bss) { ssid = bss->ssid; @@ -1922,33 +1921,34 @@ static char * __prism2_translate_scan(lo } /* TODO: add BeaconInt,resp_rate,atim into BSS table */ - buf = kmalloc(MAX_WPA_IE_LEN * 2 + 30, GFP_ATOMIC); - if (buf && scan) { + if (local->translate_scan_buf && scan) { memset(&iwe, 0, sizeof(iwe)); iwe.cmd = IWEVCUSTOM; - sprintf(buf, "bcn_int=%d", le16_to_cpu(scan->beacon_interval)); - iwe.u.data.length = strlen(buf); + sprintf(local->translate_scan_buf, "bcn_int=%d", + le16_to_cpu(scan->beacon_interval)); + iwe.u.data.length = strlen(local->translate_scan_buf); current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, - buf); + local->translate_scan_buf); memset(&iwe, 0, sizeof(iwe)); iwe.cmd = IWEVCUSTOM; - sprintf(buf, "resp_rate=%d", le16_to_cpu(scan->rate)); - iwe.u.data.length = strlen(buf); + sprintf(local->translate_scan_buf, "resp_rate=%d", + le16_to_cpu(scan->rate)); + iwe.u.data.length = strlen(local->translate_scan_buf); current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, - buf); + local->translate_scan_buf); if (local->last_scan_type == PRISM2_HOSTSCAN && (capabilities & WLAN_CAPABILITY_IBSS)) { memset(&iwe, 0, sizeof(iwe)); iwe.cmd = IWEVCUSTOM; - sprintf(buf, "atim=%d", le16_to_cpu(scan->atim)); - iwe.u.data.length = strlen(buf); + sprintf(local->translate_scan_buf, "atim=%d", + le16_to_cpu(scan->atim)); + iwe.u.data.length = strlen(local->translate_scan_buf); current_ev = iwe_stream_add_point(current_ev, end_buf, - &iwe, buf); + &iwe, local->translate_scan_buf); } } - kfree(buf); if (bss && bss->wpa_ie_len > 0 && bss->wpa_ie_len <= MAX_WPA_IE_LEN) { memset(&iwe, 0, sizeof(iwe)); diff --git a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h index cfd8015..7f9d747 100644 --- a/drivers/net/wireless/hostap/hostap_wlan.h +++ b/drivers/net/wireless/hostap/hostap_wlan.h @@ -869,6 +869,10 @@ struct local_info { /* Pointer to hardware model specific (cs,pci,plx) private data. */ void *hw_priv; + +#ifndef PRISM2_NO_STATION_MODES + char translate_scan_buf[MAX_WPA_IE_LEN * 2 + 30]; +#endif /* PRISM2_NO_STATION_MODES */ }; --- 0.99.9 -- John W. Linville [EMAIL PROTECTED] - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html