diff mbox series

HID: add missing dependencies on HIDRAW

Message ID 20210818092503.16653-1-tobias.junghans@inhub.de
State New
Headers show
Series HID: add missing dependencies on HIDRAW | expand

Commit Message

Tobias Junghans Aug. 18, 2021, 9:25 a.m. UTC
hid-led, hid-u2fzero and hid-mcp2221 unconditionally access the hidraw
member of the hid_device structure to obtain the hidraw minor number.
Building without HIDRAW causes a NULL pointer dereference in the
corresponding probe handlers.

Signed-off-by: Tobias Junghans <tobias.junghans@inhub.de>
---
 drivers/hid/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

Comments

rishi gupta April 6, 2022, 3:48 p.m. UTC | #1
Thanks Tobias!

Reviewed-by: Rishi Gupta <gupt21@gmail.com>


On Wed, Aug 18, 2021 at 2:26 AM Tobias Junghans
<tobias.junghans@inhub.de> wrote:
>
> hid-led, hid-u2fzero and hid-mcp2221 unconditionally access the hidraw
> member of the hid_device structure to obtain the hidraw minor number.
> Building without HIDRAW causes a NULL pointer dereference in the
> corresponding probe handlers.
>
> Signed-off-by: Tobias Junghans <tobias.junghans@inhub.de>
> ---
>  drivers/hid/Kconfig | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 160554903ef9..00416b3091e7 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -522,6 +522,7 @@ config HID_LCPOWER
>  config HID_LED
>         tristate "Simple RGB LED support"
>         depends on HID
> +       depends on HIDRAW
>         depends on LEDS_CLASS
>         help
>         Support for simple RGB LED devices. Currently supported are:
> @@ -1093,6 +1094,7 @@ config HID_UDRAW_PS3
>  config HID_U2FZERO
>         tristate "U2F Zero LED and RNG support"
>         depends on USB_HID
> +       depends on HIDRAW
>         depends on LEDS_CLASS
>         depends on HW_RANDOM
>         help
> @@ -1213,6 +1215,7 @@ config HID_ALPS
>  config HID_MCP2221
>         tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
>         depends on USB_HID && I2C
> +       depends on HIDRAW
>         depends on GPIOLIB
>         help
>         Provides I2C and SMBUS host adapter functionality over USB-HID
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 160554903ef9..00416b3091e7 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -522,6 +522,7 @@  config HID_LCPOWER
 config HID_LED
 	tristate "Simple RGB LED support"
 	depends on HID
+	depends on HIDRAW
 	depends on LEDS_CLASS
 	help
 	Support for simple RGB LED devices. Currently supported are:
@@ -1093,6 +1094,7 @@  config HID_UDRAW_PS3
 config HID_U2FZERO
 	tristate "U2F Zero LED and RNG support"
 	depends on USB_HID
+	depends on HIDRAW
 	depends on LEDS_CLASS
 	depends on HW_RANDOM
 	help
@@ -1213,6 +1215,7 @@  config HID_ALPS
 config HID_MCP2221
 	tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
 	depends on USB_HID && I2C
+	depends on HIDRAW
 	depends on GPIOLIB
 	help
 	Provides I2C and SMBUS host adapter functionality over USB-HID