aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@nokia.com>2010-11-30 07:58:46 -0500
committerLuciano Coelho <luciano.coelho@nokia.com>2010-12-02 09:17:19 -0500
commit43a598d5e40485fcfbebe0700077e83afd803ed5 (patch)
tree323ade5d998f39a89e8d71e644660ea572eed1e2
parentd60080ae06b98790036104f07fa897cfc151ce12 (diff)
wl12xx: fix illegal memset if debugfs is not enabled
If we try to reset the debugfs statistics when debugfs is not configured in the kernel, we're memset an illegal pointer, because it has never been allocated. So check whether we have debugfs enabled by looking into the wl->rootdir before trying to reset the fw_stats struct. Reported-by: Joerie de Gram <j.de.gram@gmail.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
-rw-r--r--drivers/net/wireless/wl12xx/debugfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index 2ac289e51484..8106a6c8a1ba 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -414,6 +414,9 @@ err:
414 414
415void wl1271_debugfs_reset(struct wl1271 *wl) 415void wl1271_debugfs_reset(struct wl1271 *wl)
416{ 416{
417 if (!wl->rootdir)
418 return;
419
417 memset(wl->stats.fw_stats, 0, sizeof(*wl->stats.fw_stats)); 420 memset(wl->stats.fw_stats, 0, sizeof(*wl->stats.fw_stats));
418 wl->stats.retry_count = 0; 421 wl->stats.retry_count = 0;
419 wl->stats.excessive_retries = 0; 422 wl->stats.excessive_retries = 0;