]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadget: Check bmAttributes only if configuration is valid
authorPrashanth K <prashanth.k@oss.qualcomm.com>
Mon, 24 Feb 2025 08:56:04 +0000 (14:26 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:51:09 +0000 (12:51 +0100)
commitc3a772540220af317ec9e4b8ebcdec6eb5afe9c2
tree604412b954edc8767d15d50b7d29a022ec00fac1
parent7e6b36d92dce283324d7f39b9b5010d7c7fccc1f
usb: gadget: Check bmAttributes only if configuration is valid

commit 8e812e9355a6f14dffd54a33d951ca403b9732f5 upstream.

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

Cc: stable <stable@kernel.org>
Fixes: 40e89ff5750f ("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>
drivers/usb/gadget/composite.c