Merge tag 'for-5.11/dm-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/device...
[linux-2.6-microblaze.git] / sound / usb / clock.c
index e940dce..31051f2 100644 (file)
@@ -534,6 +534,12 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip,
        }
 
        crate = data[0] | (data[1] << 8) | (data[2] << 16);
+       if (!crate) {
+               dev_info(&dev->dev, "failed to read current rate; disabling the check\n");
+               chip->sample_rate_read_error = 3; /* three strikes, see above */
+               return 0;
+       }
+
        if (crate != rate) {
                dev_warn(&dev->dev, "current rate %d is different from the runtime rate %d\n", crate, rate);
                // runtime->rate = crate;