From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751987AbdGFIrj (ORCPT ); Thu, 6 Jul 2017 04:47:39 -0400 Received: from lucky1.263xmail.com ([211.157.147.133]:45406 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbdGFIrh (ORCPT ); Thu, 6 Jul 2017 04:47:37 -0400 X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 0 X-SKE-CHECKED: 0 X-ANTISPAM-LEVEL: 2 X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: briannorris@chromium.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <19e534217e08499f6206c1844ec97ac0> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <595DF921.2020108@rock-chips.com> Date: Thu, 06 Jul 2017 16:47:29 +0800 From: jeffy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130126 Thunderbird/19.0 MIME-Version: 1.0 To: Brian Norris CC: linux-wireless@vger.kernel.org, akarwar@marvell.com, Xinming Hu , Kalle Valo , Ganapathi Bhat , Amitkumar Karwar , linux-kernel@vger.kernel.org, Nishant Sarmukadam , netdev@vger.kernel.org Subject: Re: [PATCH] mwifiex: uninit wakeup info when failed to add card References: <1499068470-8022-1-git-send-email-jeffy.chen@rock-chips.com> <20170705180813.GA115427@google.com> In-Reply-To: <20170705180813.GA115427@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi brian, On 07/06/2017 02:08 AM, Brian Norris wrote: > On Mon, Jul 03, 2017 at 03:54:30PM +0800, Jeffy Chen wrote: >> We inited wakeup info at the beginning of mwifiex_add_card, so we need >> to uninit it in the error handling. >> >> It's much the same as what we did in: >> 36908c4 mwifiex: uninit wakeup info when removing device > > Yeah, I noticed I hadn't covered all the error cases, so your change is > part of the fix. But you're not covering the error paths when the > firmware doesn't load correctly -- this happens asynchronously to > mwifiex_add_card(). i.e., you need to fixup the error paths in > _mwifiex_fw_dpc() too. right, so we need to uninit it before every mwifiex_free_adapter :) > > Brian > >> Signed-off-by: Jeffy Chen >> >> --- >> >> drivers/net/wireless/marvell/mwifiex/main.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c >> index f2600b8..17d2cbe 100644 >> --- a/drivers/net/wireless/marvell/mwifiex/main.c >> +++ b/drivers/net/wireless/marvell/mwifiex/main.c >> @@ -1655,6 +1655,8 @@ mwifiex_add_card(void *card, struct completion *fw_done, >> mwifiex_shutdown_drv(adapter); >> } >> err_kmalloc: >> + if (adapter->irq_wakeup >= 0) >> + device_init_wakeup(adapter->dev, false); >> mwifiex_free_adapter(adapter); >> >> err_init_sw: >> -- >> 2.1.4 >> >> > > >