linux/drivers/usb/gadget
Prashanth K 2c271df318 usb: gadget: Check bmAttributes only if configuration is valid
commit 8e812e9355 upstream.

If the USB configuration is not valid, then avoid checking for
bmAttributes to prevent null pointer deference.

Cc: stable <stable@kernel.org>
Fixes: 40e89ff575 ("usb: gadget: Set self-powered based on MaxPower and bmAttributes")
Signed-off-by: Prashanth K <prashanth.k@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250224085604.417327-1-prashanth.k@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-03-13 12:58:35 +01:00
..
function usb: gadget: u_ether: Set is_suspend flag if remote wakeup fails 2025-03-13 12:58:34 +01:00
legacy usb: gadget: webcam: Make g_webcam loadable again 2024-01-25 15:35:53 -08:00
udc usb: gadget: core: flush gadget workqueue after device removal 2025-02-27 04:10:47 -08:00
composite.c usb: gadget: Check bmAttributes only if configuration is valid 2025-03-13 12:58:35 +01:00
config.c usb: gadget: config: remove max speed check in usb_assign_descriptors() 2023-08-22 14:48:33 +02:00
configfs.c usb: gadget: configfs: Ignore trailing LF for user strings to cdev 2025-01-17 13:36:22 +01:00
configfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
epautoconf.c usb: gadget: fix for a typo that conveys logically-inverted information. 2021-09-14 10:27:54 +02:00
functions.c USB: add SPDX identifiers to all remaining files in drivers/usb/ 2017-11-04 11:48:02 +01:00
Kconfig usb: gadget: midi2: Reverse-select at the right place 2025-01-17 13:36:22 +01:00
Makefile usb: gadget: Makefile: remove ccflags-y 2022-03-18 12:56:08 +01:00
u_f.c usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
u_f.h USB: gadget: u_f: Unbreak offset calculation in VLAs 2020-08-27 09:25:06 +02:00
u_os_desc.h usb: gadget: Change Andrzej Pietrasiewicz's e-mail address 2019-02-11 11:12:29 +02:00
usbstring.c usb: gadget: fix langid kernel-doc warning in usbstring.c 2020-07-09 10:13:07 +03:00