From patchwork Fri Oct 2 22:57:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Buesch X-Patchwork-Id: 51481 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n92MwvEp012495 for ; Fri, 2 Oct 2009 22:58:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756608AbZJBW6k (ORCPT ); Fri, 2 Oct 2009 18:58:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753001AbZJBW6k (ORCPT ); Fri, 2 Oct 2009 18:58:40 -0400 Received: from bu3sch.de ([62.75.166.246]:35726 "EHLO vs166246.vserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756538AbZJBW6j (ORCPT ); Fri, 2 Oct 2009 18:58:39 -0400 Received: by vs166246.vserver.de with esmtpa (Exim 4.69) id 1Mtr5G-0004bI-U8; Fri, 02 Oct 2009 22:58:43 +0000 From: Michael Buesch To: linville@tuxdriver.com Subject: [PATCH] b43: Protect sanity check against physical device removal Date: Sat, 3 Oct 2009 00:57:58 +0200 User-Agent: KMail/1.9.9 Cc: bcm43xx-dev@lists.berlios.de, linux-wireless@vger.kernel.org, Andrew Price X-Move-Along: Nothing to see here. No, really... Nothing. MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200910030058.00906.mb@bu3sch.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --- wireless-testing.orig/drivers/net/wireless/b43/main.c +++ wireless-testing/drivers/net/wireless/b43/main.c @@ -3874,6 +3874,7 @@ static struct b43_wldev * b43_wireless_c { struct b43_wl *wl = dev->wl; struct b43_wldev *orig_dev; + u32 mask; redo: if (!dev || b43_status(dev) < B43_STAT_STARTED) @@ -3920,7 +3921,8 @@ redo: goto redo; return dev; } - B43_WARN_ON(b43_read32(dev, B43_MMIO_GEN_IRQ_MASK)); + mask = b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); + B43_WARN_ON(mask != 0xFFFFFFFF && mask); /* Drain the TX queue */ while (skb_queue_len(&wl->tx_queue))