Merge tag 'mediatek-drm-next-5.13' of https://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / sound / usb / mixer.c
index b1c78db..b004b2e 100644 (file)
@@ -1307,6 +1307,17 @@ no_res_check:
                        /* totally crap, return an error */
                        return -EINVAL;
                }
+       } else {
+               /* if the max volume is too low, it's likely a bogus range;
+                * here we use -96dB as the threshold
+                */
+               if (cval->dBmax <= -9600) {
+                       usb_audio_info(cval->head.mixer->chip,
+                                      "%d:%d: bogus dB values (%d/%d), disabling dB reporting\n",
+                                      cval->head.id, mixer_ctrl_intf(cval->head.mixer),
+                                      cval->dBmin, cval->dBmax);
+                       cval->dBmin = cval->dBmax = 0;
+               }
        }
 
        return 0;