From patchwork Wed May 20 14:02:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Eriksson X-Patchwork-Id: 6446591 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9381CC0432 for ; Wed, 20 May 2015 14:02:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 950C32035E for ; Wed, 20 May 2015 14:02:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B12B2034E for ; Wed, 20 May 2015 14:02:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752337AbbETOCT (ORCPT ); Wed, 20 May 2015 10:02:19 -0400 Received: from bastet.se.axis.com ([195.60.68.11]:37971 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530AbbETOCS (ORCPT ); Wed, 20 May 2015 10:02:18 -0400 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id 119D618131; Wed, 20 May 2015 16:02:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id IIJU9PN6PINp; Wed, 20 May 2015 16:02:16 +0200 (CEST) Received: from boulder.se.axis.com (boulder.se.axis.com [10.0.2.104]) by bastet.se.axis.com (Postfix) with ESMTP id 8854C18120; Wed, 20 May 2015 16:02:16 +0200 (CEST) Received: from boulder.se.axis.com (localhost [127.0.0.1]) by postfix.imss71 (Postfix) with ESMTP id 55CBBED8; Wed, 20 May 2015 16:02:16 +0200 (CEST) Received: from seth.se.axis.com (seth.se.axis.com [10.0.2.172]) by boulder.se.axis.com (Postfix) with ESMTP id 492E2E82; Wed, 20 May 2015 16:02:16 +0200 (CEST) Received: from linux (linux.se.axis.com [10.94.25.1]) by seth.se.axis.com (Postfix) with SMTP id 46AC73E049; Wed, 20 May 2015 16:02:15 +0200 (CEST) Received: by linux (sSMTP sendmail emulation); Wed, 20 May 2015 16:02:15 +0200 Date: Wed, 20 May 2015 16:02:15 +0200 From: Henrik Eriksson To: brcm80211-dev-list@broadcom.com, linux-wireless@vger.kernel.org Subject: [PATCH] brcmfmac: clear sdiodev->pdata if irq_of_parse_and_map fails Message-ID: <20150520140206.GA11272@linux.se.axis.com> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clear the pdata pointer in sdiodev after freeing the memory. In my case not doing so interferes with device initialization as request_irq of sdiodev->pdata->oob_irq_nr fails, but even if not, leaving a wild pointer is incorrect. Signed-off-by: Henrik Eriksson --- drivers/net/wireless/brcm80211/brcmfmac/of.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/of.c b/drivers/net/wireless/brcm80211/brcmfmac/of.c index c824570..71ead7b 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c @@ -43,6 +43,7 @@ void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev) if (!irq) { brcmf_err("interrupt could not be mapped\n"); devm_kfree(dev, sdiodev->pdata); + sdiodev->pdata = NULL; return; } irqf = irqd_get_trigger_type(irq_get_irq_data(irq));