From: Tim Gardner <rtg.canonical@gmail.com>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Tim Gardner <tim.gardner@canonical.com>,
Chaoming Li <chaoming_li@realsil.com.cn>,
"John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtlwifi: Fix PCI probe error path orphaned memory
Date: Thu, 02 Feb 2012 16:59:26 -0700 [thread overview]
Message-ID: <4F2B235E.9040004@gmail.com> (raw)
In-Reply-To: <4F2B1BB7.6020608@lwfinger.net>
On 02/02/2012 04:26 PM, Larry Finger wrote:
> On 02/02/2012 02:48 PM, Tim Gardner wrote:
>> Memory allocated by ieee80211_alloc_hw() will get orphaned
>> if any subsequent initializations fail.
>>
>> Also don't pci_set_drvdata(pdev, NULL) until just before disabling
>> the PCI device. Functions called by rtl_deinit_core(hw) may eventually
>> need
>> the context (when its actually implemented).
>>
>> Cc: Larry Finger<Larry.Finger@lwfinger.net>
>> Cc: Chaoming Li<chaoming_li@realsil.com.cn>
>> Cc: John W. Linville<linville@tuxdriver.com>
>> Cc: linux-wireless@vger.kernel.org
>> Cc: netdev@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> Signed-off-by: Tim Gardner<tim.gardner@canonical.com>
>> ---
>> drivers/net/wireless/rtlwifi/pci.c | 19 ++++++++++++-------
>> 1 files changed, 12 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rtlwifi/pci.c
>> b/drivers/net/wireless/rtlwifi/pci.c
>> index 5cb2199..6b18063 100644
>> --- a/drivers/net/wireless/rtlwifi/pci.c
>> +++ b/drivers/net/wireless/rtlwifi/pci.c
>> @@ -1760,8 +1760,8 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
>> if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
>> RT_ASSERT(false,
>> "Unable to obtain 32bit DMA for consistent allocations\n");
>> - pci_disable_device(pdev);
>> - return -ENOMEM;
>> + err = -ENOMEM;
>> + goto fail1;
>
> I would probably added a new label after the ieee80211_free_hw() and
> used it here to avoid the "if (hw)" test, but that is a matter of
> choice. In any case this patch is correct.
>
> ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
>
> Thanks,
>
> Larry
>
Actually, I started doing that but it turned into a huge patch, so I
just decided to solved the immediate issue (discovered by inspection).
There are some other setup/teardown nonorthogonalities that need fixing
first (which I'm pursuing as time allows).
rtg
--
Tim Gardner tim.gardner@canonical.com
prev parent reply other threads:[~2012-02-02 23:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-02 20:48 [PATCH] rtlwifi: Fix PCI probe error path orphaned memory Tim Gardner
2012-02-02 23:26 ` Larry Finger
2012-02-02 23:59 ` Tim Gardner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F2B235E.9040004@gmail.com \
--to=rtg.canonical@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=chaoming_li@realsil.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
--cc=tim.gardner@canonical.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).