]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
USB: gadget: udc: fix const issue in gadget_match_driver()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 May 2025 13:41:40 +0000 (15:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2025 13:32:13 +0000 (15:32 +0200)
commit9f40ae8310a76dea0e814c1365d0c08eae465181
tree5e8e634f4d921b36c353d889aadd80942f99f673
parentad2fc59a67036a298d948de3ad1ffb786c950102
USB: gadget: udc: fix const issue in gadget_match_driver()

[ Upstream commit 5f5cc794fac605afd3bef8065e33096aeacf6257 ]

gadget_match_driver() takes a const pointer, and then decides to cast it
away into a non-const one, which is not a good thing to do overall.  Fix
this up by properly setting the pointers to be const to preserve that
attribute.

Fixes: d69d80484598 ("driver core: have match() callback in struct bus_type take a const *")
Link: https://lore.kernel.org/r/2025052139-rash-unsaddle-7c5e@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/udc/core.c