Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-6.13/bug-on-to-warn-on' into for-linus

- removal of three way-too-aggressive BUG_ON()s from HID drivers (He Lugang)

+6 -3
+2 -1
drivers/hid/hid-cp2112.c
··· 852 852 { 853 853 int ret; 854 854 855 - BUG_ON(cfg->report != CP2112_USB_CONFIG); 855 + if (WARN_ON(cfg->report != CP2112_USB_CONFIG)) 856 + return -EINVAL; 856 857 857 858 ret = cp2112_hid_output(hdev, (u8 *)cfg, sizeof(*cfg), 858 859 HID_FEATURE_REPORT);
+2 -1
drivers/hid/hid-lg4ff.c
··· 1350 1350 1351 1351 /* Initialize device properties */ 1352 1352 if (mmode_ret == LG4FF_MMODE_IS_MULTIMODE) { 1353 - BUG_ON(mmode_idx == -1); 1353 + if (WARN_ON(mmode_idx == -1)) 1354 + return -EINVAL; 1354 1355 mmode_wheel = &lg4ff_multimode_wheels[mmode_idx]; 1355 1356 } 1356 1357 lg4ff_init_wheel_data(&entry->wdata, &lg4ff_devices[i], mmode_wheel, real_product_id);
+2 -1
drivers/hid/hid-sony.c
··· 1379 1379 u8 max_brightness[MAX_LEDS] = { [0 ... (MAX_LEDS - 1)] = 1 }; 1380 1380 u8 use_hw_blink[MAX_LEDS] = { 0 }; 1381 1381 1382 - BUG_ON(!(sc->quirks & SONY_LED_SUPPORT)); 1382 + if (WARN_ON(!(sc->quirks & SONY_LED_SUPPORT))) 1383 + return -EINVAL; 1383 1384 1384 1385 if (sc->quirks & BUZZ_CONTROLLER) { 1385 1386 sc->led_count = 4;