2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-25 05:34:00 +08:00

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>
This commit is contained in:
Luciano Coelho 2010-11-30 14:58:46 +02:00
parent d60080ae06
commit 43a598d5e4

View File

@ -414,6 +414,9 @@ err:
void wl1271_debugfs_reset(struct wl1271 *wl)
{
if (!wl->rootdir)
return;
memset(wl->stats.fw_stats, 0, sizeof(*wl->stats.fw_stats));
wl->stats.retry_count = 0;
wl->stats.excessive_retries = 0;