提交 43a598d5 编写于 作者: L Luciano Coelho

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: NJoerie de Gram <j.de.gram@gmail.com>
Signed-off-by: NLuciano Coelho <luciano.coelho@nokia.com>
上级 d60080ae
......@@ -414,6 +414,9 @@ static int wl1271_debugfs_add_files(struct wl1271 *wl)
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册