From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Neeraj Upadhyay <neeraju@codeaurora.org>
Cc: pavel@ucw.cz, len.brown@intel.com, gregkh@linuxfoundation.org,
swboyd@chromium.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, irgeorgiev@codeaurora.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] PM / wakeup: Skip wakeup_source_sysfs_remove if device is not added
Date: Wed, 25 Mar 2020 11:37:49 +0100 [thread overview]
Message-ID: <45310800.nJ51lTlq64@kreacher> (raw)
In-Reply-To: <1584940131-1591-1-git-send-email-neeraju@codeaurora.org>
On Monday, March 23, 2020 6:08:51 AM CET Neeraj Upadhyay wrote:
> Skip wakeup_source_sysfs_remove(), to fix null pinter access of
> ws->dev, if wakeup source is unregistered before wakeup class
> is registered from device_add().
>
> Fixes: 2ca3d1ecb8c4 ("PM / wakeup: Register wakeup class kobj after device is added")
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
> ---
> drivers/base/power/wakeup.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
> index 27f3e60..f8f8c0a 100644
> --- a/drivers/base/power/wakeup.c
> +++ b/drivers/base/power/wakeup.c
> @@ -241,7 +241,8 @@ void wakeup_source_unregister(struct wakeup_source *ws)
> {
> if (ws) {
> wakeup_source_remove(ws);
> - wakeup_source_sysfs_remove(ws);
> + if (ws->dev)
> + wakeup_source_sysfs_remove(ws);
> wakeup_source_destroy(ws);
> }
> }
>
Applied (with some minor changes) as 5.7 material, thanks!
prev parent reply other threads:[~2020-03-25 10:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 5:08 [PATCH] PM / wakeup: Skip wakeup_source_sysfs_remove if device is not added Neeraj Upadhyay
2020-03-25 10:37 ` Rafael J. Wysocki [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=45310800.nJ51lTlq64@kreacher \
--to=rjw@rjwysocki.net \
--cc=gregkh@linuxfoundation.org \
--cc=irgeorgiev@codeaurora.org \
--cc=len.brown@intel.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=neeraju@codeaurora.org \
--cc=pavel@ucw.cz \
--cc=swboyd@chromium.org \
/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).