From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Zijun Hu <zijun_hu@icloud.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Zijun Hu <quic_zijuhu@quicinc.com>,
stable@vger.kernel.org
Subject: Re: [PATCH RESEND] PM: domains: Fix return value of API dev_pm_get_subsys_data()
Date: Tue, 12 Nov 2024 12:46:30 +0100 [thread overview]
Message-ID: <2024111257-collide-finalist-7a0c@gregkh> (raw)
In-Reply-To: <20241028-fix_dev_pm_get_subsys_data-v1-1-20385f4b1e17@quicinc.com>
On Mon, Oct 28, 2024 at 08:31:11PM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
>
> dev_pm_get_subsys_data() has below 2 issues under condition
> (@dev->power.subsys_data != NULL):
>
> - it will do unnecessary kzalloc() and kfree().
But that's ok, everything still works, right?
> - it will return -ENOMEM if the kzalloc() fails, that is wrong
> since the kzalloc() is not needed.
But it's ok to return the proper error if the system is that broken.
>
> Fixed by not doing kzalloc() and returning 0 for the condition.
>
> Fixes: ef27bed1870d ("PM: Reference counting of power.subsys_data")
> Cc: stable@vger.kernel.org
Why is this relevant for stable kernels?
thanks,
greg k-h
next prev parent reply other threads:[~2024-11-12 11:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 12:31 [PATCH RESEND] PM: domains: Fix return value of API dev_pm_get_subsys_data() Zijun Hu
2024-11-12 11:46 ` Greg Kroah-Hartman [this message]
2024-11-12 14:58 ` Zijun Hu
2024-11-13 12:59 ` Zijun Hu
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=2024111257-collide-finalist-7a0c@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=quic_zijuhu@quicinc.com \
--cc=rafael@kernel.org \
--cc=stable@vger.kernel.org \
--cc=zijun_hu@icloud.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.