Re: [PATCH] staging: greybus: fix possible null-ptr-deref in gb_audio_manager_get_module()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2024/10/28 20:46, Alex Elder wrote:
On 10/26/24 5:50 AM, Dan Carpenter wrote:
On Sat, Oct 26, 2024 at 08:11:53AM +0000, Yi Yang wrote:
The gb_audio_manager_get_module() is EXPORT_SYMBOL, and will return NULL
when incoming parameter id < 0, fix possible null-ptr-deref by add check
for return value.

Fixes: 8db00736d365 ("greybus: audio: Add Audio Manager")
Signed-off-by: Yi Yang <yiyang13@xxxxxxxxxx>

Where is gb_audio_manager_get_module() called from?  So far as I can see it's
never used.  Why not just delete it?

regards,
dan carpenter

I agree with this.  I suspected all callers might have guaranteed
that the "id" value passed would be always valid, but... there are
no callers.

It is a simple function, and could be added back again if it is
needed in the future (possibly even by reverting the commit that
removes it).

If you do this, please remove gb_audio_put_module() in the same
patch.  It too has no callers.

Thank you.

                     -Alex

.

I tried to find the caller before I modified it, but unfortunately I didn't find the caller, so I suspect some non-kernel driver code will try to call this functions.

I just found this problem while reading the code and I'm not sure if I should remove the function.

regards,
Yiyang
--
_______________________________________________
greybus-dev mailing list -- greybus-dev@xxxxxxxxxxxxxxxx
To unsubscribe send an email to greybus-dev-leave@xxxxxxxxxxxxxxxx




[Index of Archives]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]     [Asterisk Books]

  Powered by Linux