From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Hardik Phalet <hardik.phalet@pm.me>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
Vaibhav Agarwal <vaibhav.sr@gmail.com>,
Mark Greer <mgreer@animalcreek.com>,
greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] staging: greybus: audio: fix NULL dereference in gb_audio_manager_get_module()
Date: Mon, 23 Feb 2026 14:54:33 +0100 [thread overview]
Message-ID: <2026022310-unleaded-scoundrel-d443@gregkh> (raw)
In-Reply-To: <DGJPGRAT9SXJ.1JK6YJQ9SJLNT@pm.me>
On Fri, Feb 20, 2026 at 10:09:33AM +0000, Hardik Phalet wrote:
> On Fri Feb 20, 2026 at 1:38 PM IST, Dan Carpenter wrote:
> > On Fri, Feb 20, 2026 at 06:30:10AM +0000, Hardik Phalet wrote:
> >> gb_audio_manager_get_module() calls gb_audio_manager_get_locked(), which
> >> can return NULL when the requested id does not exist. The returned
> >> pointer is dereferenced unconditionally via kobject_get(), leading to a
> >> NULL pointer dereference.
> >>
> >> Only take a kobject reference when the module is found.
> >>
> >> Signed-off-by: Hardik Phalet <hardik.phalet@pm.me>
> >> ---
> >> drivers/staging/greybus/audio_manager.c | 3 ++-
> >> 1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/staging/greybus/audio_manager.c b/drivers/staging/greybus/audio_manager.c
> >> index 27ca5f796c5f..1da8804e61ca 100644
> >> --- a/drivers/staging/greybus/audio_manager.c
> >> +++ b/drivers/staging/greybus/audio_manager.c
> >> @@ -111,7 +111,8 @@ struct gb_audio_manager_module *gb_audio_manager_get_module(int id)
> >
> > I don't think this gb_audio_manager_get_module() function is ever
> > called. If it is then we need a Fixes tag.
> >
> > regards,
> > dan carpenter
>
> Thanks for pointing that out.
>
> I double-checked and could not find any in-tree callers for
> gb_audio_manager_get_module(), so this appears to be dead code and the
> NULL dereference is not reachable today.
>
> Would you prefer that I drop this fix, or should I follow up with a
> cleanup patch?
Redo the series and just remove the unused functions entirely.
thanks,
greg k-h
next prev parent reply other threads:[~2026-02-23 13:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 6:30 [PATCH v2 0/2] staging: greybus: audio: small fixes Hardik Phalet
2026-02-20 6:30 ` [PATCH v2 1/2] staging: greybus: audio: fix NULL dereference in gb_audio_manager_get_module() Hardik Phalet
2026-02-20 8:08 ` Dan Carpenter
2026-02-20 10:09 ` Hardik Phalet
2026-02-23 13:54 ` Greg Kroah-Hartman [this message]
2026-02-20 6:30 ` [PATCH v2 2/2] staging: greybus: audio: drop stale TODO in module release Hardik Phalet
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=2026022310-unleaded-scoundrel-d443@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=dan.carpenter@linaro.org \
--cc=elder@kernel.org \
--cc=greybus-dev@lists.linaro.org \
--cc=hardik.phalet@pm.me \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mgreer@animalcreek.com \
--cc=vaibhav.sr@gmail.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