* [PATCH] wl12xx: fix illegal memset if debugfs is not enabled
@ 2010-11-30 13:03 luciano.coelho
2010-12-02 14:37 ` Luciano Coelho
0 siblings, 1 reply; 2+ messages in thread
From: luciano.coelho @ 2010-11-30 13:03 UTC (permalink / raw)
To: linux-wireless; +Cc: luciano.coelho, j.de.gram
From: Luciano Coelho <luciano.coelho@nokia.com>
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>
---
drivers/net/wireless/wl12xx/debugfs.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index 2ac289e..8106a6c 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -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;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] wl12xx: fix illegal memset if debugfs is not enabled
2010-11-30 13:03 [PATCH] wl12xx: fix illegal memset if debugfs is not enabled luciano.coelho
@ 2010-12-02 14:37 ` Luciano Coelho
0 siblings, 0 replies; 2+ messages in thread
From: Luciano Coelho @ 2010-12-02 14:37 UTC (permalink / raw)
To: linux-wireless; +Cc: j.de.gram
On Tue, 2010-11-30 at 15:03 +0200, luciano.coelho@nokia.com wrote:
> From: Luciano Coelho <luciano.coelho@nokia.com>
>
> 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>
> ---
Applied and pushed to wl12xx.
--
Cheers,
Luca.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-02 14:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-30 13:03 [PATCH] wl12xx: fix illegal memset if debugfs is not enabled luciano.coelho
2010-12-02 14:37 ` Luciano Coelho
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).