From patchwork Tue Nov 30 13:03:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luciano Coelho X-Patchwork-Id: 366791 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAUD1tx4029476 for ; Tue, 30 Nov 2010 13:02:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751418Ab0K3NCf (ORCPT ); Tue, 30 Nov 2010 08:02:35 -0500 Received: from smtp.nokia.com ([147.243.1.47]:49382 "EHLO mgw-sa01.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059Ab0K3NCf (ORCPT ); Tue, 30 Nov 2010 08:02:35 -0500 Received: from nokia.com (localhost [127.0.0.1]) by mgw-sa01.nokia.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id oAUD2WjM002619; Tue, 30 Nov 2010 15:02:32 +0200 Received: from localhost.localdomain ([esdhcp040213.research.nokia.com [172.21.40.213]]) by mgw-sa01.nokia.com with RELAY id oAUD2Sbt002398 ; Tue, 30 Nov 2010 15:02:29 +0200 From: luciano.coelho@nokia.com To: linux-wireless@vger.kernel.org Cc: luciano.coelho@nokia.com, j.de.gram@gmail.com Subject: [PATCH] wl12xx: fix illegal memset if debugfs is not enabled Date: Tue, 30 Nov 2010 15:03:13 +0200 Message-Id: <1291122193-3409-1-git-send-email-luciano.coelho@nokia.com> X-Mailer: git-send-email 1.7.0.4 X-Nokia-AV: Clean Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 30 Nov 2010 13:02:37 +0000 (UTC) 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;