From: Darren Hart <dvhart@infradead.org>
To: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
Cc: platform-driver-x86@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>,
Kirill Tkhai <tkhai@yandex.ru>
Subject: Re: [PATCH 1/2] hp-wmi: fix unregister order in hp_wmi_rfkill_setup() once again
Date: Tue, 8 Mar 2016 18:01:11 +0100 [thread overview]
Message-ID: <20160308170111.GE31742@dvhart-mobl5.amr.corp.intel.com> (raw)
In-Reply-To: <56DEF6B0.9050902@maciej.szmigiero.name>
On Tue, Mar 08, 2016 at 04:58:40PM +0100, Maciej S. Szmigiero wrote:
> Hi Darren,
>
> Thanks for review, see also my comments below.
>
> On 08.03.2016 13:39, Darren Hart wrote:
> > On Sun, Mar 06, 2016 at 11:38:36PM +0100, Maciej S. Szmigiero wrote:
> >> --- a/drivers/platform/x86/hp-wmi.c
> >> +++ b/drivers/platform/x86/hp-wmi.c
> >> @@ -746,7 +746,7 @@ static int __init hp_wmi_rfkill_setup(struct platform_device *device)
> >> (void *) HPWMI_BLUETOOTH);
> >> if (!bluetooth_rfkill) {
> >> err = -ENOMEM;
> >> - goto register_wifi_error;
> >> + goto register_bluetooth_error;
> >
> > In this and all cases below, the goto label should match the situation, jumping
> > to register_bluetooth_error would be incorrect as we experienced a wifi error.
>
> Here we experienced an BT error - BT rkill allocation failed,
> so jump is to "register_bluetooth_error".
>
> The second jump to "register_bluetooth_error" is in another case of BT error:
> when its rfkill registration failed.
>
> It is the same label since if BT rfkill allocation had failed
> rfkill_destroy(bluetooth_rfkill) call in cleanup does nothing but we still
> need to possibly unregister WiFi rfkill that might have been registered in
> a previews block (and then fall through to next label to destroy WiFi rfkill).
>
> It would be possible to have separate jump labels skipping unnecessary
> rfkill_destroy() calls on allocation failure, but this would mean
> that we would have 7 labels in such small block of cleanup code.
My apologies, I read through this too quickly. The patch is correct as is.
I have wrapped the commit message at 75 characters and queued to the testing
branch.
The one thing that's missing in the commit message is a description of how this
was failing. It can, however, be inferred.
Thanks for the patient reply, I deserved a slap for my initial response.
--
Darren Hart
Intel Open Source Technology Center
prev parent reply other threads:[~2016-03-08 17:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-06 22:38 Maciej S. Szmigiero
2016-03-08 12:39 ` Darren Hart
2016-03-08 15:58 ` Maciej S. Szmigiero
2016-03-08 17:01 ` Darren Hart [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=20160308170111.GE31742@dvhart-mobl5.amr.corp.intel.com \
--to=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mail@maciej.szmigiero.name \
--cc=platform-driver-x86@vger.kernel.org \
--cc=tkhai@yandex.ru \
/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
all inboxes | Powered by JetHome®