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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-6.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"A collection of small fixes:

- Potential OOB access fixes in USB-audio driver

- ASoC kconfig menu fix for improving the generic drivers

- HD-audio quirks and a fix revert

- Codec and platform-specific small fixes for ASoC"

* tag 'sound-6.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/tas2781: Normalize the volume kcontrol name
ALSA: usb-audio: Validate UAC3 cluster segment descriptors
ALSA: usb-audio: Validate UAC3 power domain descriptors, too
Revert "ALSA: hda: Add ASRock X670E Taichi to denylist"
ALSA: azt3328: Put __maybe_unused for inline functions for gameport
ASoC: tas2781: Normalize the volume kcontrol name
ASoC: stm: stm32_i2s: Fix calc_clk_div() error handling in determine_rate()
ASoC: codecs: Call strscpy() with correct size argument
ALSA: hda/realtek: Fix headset mic on HONOR BRB-X
ALSA: hda/realtek: Add Framework Laptop 13 (AMD Ryzen AI 300) to quirks
ASoC: tas2781: Fix spelling mistake "dismatch" -> "mismatch"
ASoC: rt1320: fix random cycle mute issue
ASoC: rt721: fix FU33 Boost Volume control not working
ASoC: generic: tidyup standardized ASoC menu for generic
ASoC: codec: sma1307: replace spelling mistake with new error message
ASoC: codecs: tx-macro: correct tx_macro_component_drv name
ASoC: fsl_sai: replace regmap_write with regmap_update_bits

+86 -59
+2
sound/hda/codecs/realtek/alc269.c
··· 7140 7140 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), 7141 7141 SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC), 7142 7142 SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 7143 + SND_PCI_QUIRK(0x1ee7, 0x2078, "HONOR BRB-X M1010", ALC2XX_FIXUP_HEADSET_MIC), 7143 7144 SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2), 7144 7145 SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 7145 7146 SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), ··· 7159 7158 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 7160 7159 SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 7161 7160 SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 7161 + SND_PCI_QUIRK(0xf111, 0x000b, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 7162 7162 SND_PCI_QUIRK(0xf111, 0x000c, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 7163 7163 7164 7164 #if 0
+1 -1
sound/hda/codecs/side-codecs/tas2781_hda_i2c.c
··· 265 265 }; 266 266 267 267 static const struct snd_kcontrol_new tas2781_snd_controls[] = { 268 - ACARD_SINGLE_RANGE_EXT_TLV("Speaker Analog Gain", TAS2781_AMP_LEVEL, 268 + ACARD_SINGLE_RANGE_EXT_TLV("Speaker Analog Volume", TAS2781_AMP_LEVEL, 269 269 1, 0, 20, 0, tas2781_amp_getvol, 270 270 tas2781_amp_putvol, amp_vol_tlv), 271 271 ACARD_SINGLE_BOOL_EXT("Speaker Force Firmware Load", 0,
-1
sound/hda/controllers/intel.c
··· 2077 2077 { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1043, 0x874f) }, /* ASUS ROG Zenith II / Strix */ 2078 2078 { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */ 2079 2079 { PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */ 2080 - { PCI_DEVICE_SUB(0x1022, 0x15e3, 0x1022, 0xd601) }, /* ASRock X670E Taichi */ 2081 2080 {} 2082 2081 }; 2083 2082
+4 -4
sound/pci/azt3328.c
··· 412 412 outl(value, chip->ctrl_io + reg); 413 413 } 414 414 415 - static inline void 415 + static inline void __maybe_unused 416 416 snd_azf3328_game_outb(const struct snd_azf3328 *chip, unsigned reg, u8 value) 417 417 { 418 418 outb(value, chip->game_io + reg); 419 419 } 420 420 421 - static inline void 421 + static inline void __maybe_unused 422 422 snd_azf3328_game_outw(const struct snd_azf3328 *chip, unsigned reg, u16 value) 423 423 { 424 424 outw(value, chip->game_io + reg); 425 425 } 426 426 427 - static inline u8 427 + static inline u8 __maybe_unused 428 428 snd_azf3328_game_inb(const struct snd_azf3328 *chip, unsigned reg) 429 429 { 430 430 return inb(chip->game_io + reg); 431 431 } 432 432 433 - static inline u16 433 + static inline u16 __maybe_unused 434 434 snd_azf3328_game_inw(const struct snd_azf3328 *chip, unsigned reg) 435 435 { 436 436 return inw(chip->game_io + reg);
+3 -1
sound/soc/Kconfig
··· 111 111 source "sound/soc/cirrus/Kconfig" 112 112 source "sound/soc/dwc/Kconfig" 113 113 source "sound/soc/fsl/Kconfig" 114 - source "sound/soc/generic/Kconfig" 115 114 source "sound/soc/google/Kconfig" 116 115 source "sound/soc/hisilicon/Kconfig" 117 116 source "sound/soc/jz4740/Kconfig" ··· 147 148 source "sound/soc/codecs/Kconfig" 148 149 149 150 source "sound/soc/sdw_utils/Kconfig" 151 + 152 + # generic frame-work 153 + source "sound/soc/generic/Kconfig" 150 154 151 155 endif # SND_SOC 152 156
+3 -5
sound/soc/codecs/aw87390.c
··· 177 177 { 178 178 struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 179 179 struct aw87390 *aw87390 = snd_soc_component_get_drvdata(codec); 180 - char *prof_name, *name; 180 + char *prof_name; 181 181 int count, ret; 182 182 183 183 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; ··· 194 194 if (uinfo->value.enumerated.item >= count) 195 195 uinfo->value.enumerated.item = count - 1; 196 196 197 - name = uinfo->value.enumerated.name; 198 197 count = uinfo->value.enumerated.item; 199 198 200 199 ret = aw87390_dev_get_prof_name(aw87390->aw_pa, count, &prof_name); 201 200 if (ret) { 202 - strscpy(uinfo->value.enumerated.name, "null", 203 - strlen("null") + 1); 201 + strscpy(uinfo->value.enumerated.name, "null"); 204 202 return 0; 205 203 } 206 204 207 - strscpy(name, prof_name, sizeof(uinfo->value.enumerated.name)); 205 + strscpy(uinfo->value.enumerated.name, prof_name); 208 206 209 207 return 0; 210 208 }
+2 -3
sound/soc/codecs/aw88081.c
··· 914 914 915 915 ret = aw88081_dev_get_prof_name(aw88081->aw_pa, count, &prof_name); 916 916 if (ret) { 917 - strscpy(uinfo->value.enumerated.name, "null", 918 - sizeof(uinfo->value.enumerated.name)); 917 + strscpy(uinfo->value.enumerated.name, "null"); 919 918 return 0; 920 919 } 921 920 922 - strscpy(uinfo->value.enumerated.name, prof_name, sizeof(uinfo->value.enumerated.name)); 921 + strscpy(uinfo->value.enumerated.name, prof_name); 923 922 924 923 return 0; 925 924 }
+3 -5
sound/soc/codecs/aw88166.c
··· 1478 1478 { 1479 1479 struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1480 1480 struct aw88166 *aw88166 = snd_soc_component_get_drvdata(codec); 1481 - char *prof_name, *name; 1481 + char *prof_name; 1482 1482 int count, ret; 1483 1483 1484 1484 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; ··· 1495 1495 if (uinfo->value.enumerated.item >= count) 1496 1496 uinfo->value.enumerated.item = count - 1; 1497 1497 1498 - name = uinfo->value.enumerated.name; 1499 1498 count = uinfo->value.enumerated.item; 1500 1499 1501 1500 ret = aw88166_dev_get_prof_name(aw88166->aw_pa, count, &prof_name); 1502 1501 if (ret) { 1503 - strscpy(uinfo->value.enumerated.name, "null", 1504 - strlen("null") + 1); 1502 + strscpy(uinfo->value.enumerated.name, "null"); 1505 1503 return 0; 1506 1504 } 1507 1505 1508 - strscpy(name, prof_name, sizeof(uinfo->value.enumerated.name)); 1506 + strscpy(uinfo->value.enumerated.name, prof_name); 1509 1507 1510 1508 return 0; 1511 1509 }
+3 -5
sound/soc/codecs/aw88261.c
··· 819 819 { 820 820 struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 821 821 struct aw88261 *aw88261 = snd_soc_component_get_drvdata(codec); 822 - char *prof_name, *name; 822 + char *prof_name; 823 823 int count, ret; 824 824 825 825 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; ··· 836 836 if (uinfo->value.enumerated.item >= count) 837 837 uinfo->value.enumerated.item = count - 1; 838 838 839 - name = uinfo->value.enumerated.name; 840 839 count = uinfo->value.enumerated.item; 841 840 842 841 ret = aw88261_dev_get_prof_name(aw88261->aw_pa, count, &prof_name); 843 842 if (ret) { 844 - strscpy(uinfo->value.enumerated.name, "null", 845 - strlen("null") + 1); 843 + strscpy(uinfo->value.enumerated.name, "null"); 846 844 return 0; 847 845 } 848 846 849 - strscpy(name, prof_name, sizeof(uinfo->value.enumerated.name)); 847 + strscpy(uinfo->value.enumerated.name, prof_name); 850 848 851 849 return 0; 852 850 }
+3 -5
sound/soc/codecs/aw88395/aw88395.c
··· 175 175 { 176 176 struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 177 177 struct aw88395 *aw88395 = snd_soc_component_get_drvdata(codec); 178 - char *prof_name, *name; 178 + char *prof_name; 179 179 int count, ret; 180 180 181 181 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; ··· 192 192 if (uinfo->value.enumerated.item >= count) 193 193 uinfo->value.enumerated.item = count - 1; 194 194 195 - name = uinfo->value.enumerated.name; 196 195 count = uinfo->value.enumerated.item; 197 196 198 197 ret = aw88395_dev_get_prof_name(aw88395->aw_pa, count, &prof_name); 199 198 if (ret) { 200 - strscpy(uinfo->value.enumerated.name, "null", 201 - strlen("null") + 1); 199 + strscpy(uinfo->value.enumerated.name, "null"); 202 200 return 0; 203 201 } 204 202 205 - strscpy(name, prof_name, sizeof(uinfo->value.enumerated.name)); 203 + strscpy(uinfo->value.enumerated.name, prof_name); 206 204 207 205 return 0; 208 206 }
+3 -5
sound/soc/codecs/aw88399.c
··· 1831 1831 { 1832 1832 struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1833 1833 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 1834 - char *prof_name, *name; 1834 + char *prof_name; 1835 1835 int count, ret; 1836 1836 1837 1837 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; ··· 1848 1848 if (uinfo->value.enumerated.item >= count) 1849 1849 uinfo->value.enumerated.item = count - 1; 1850 1850 1851 - name = uinfo->value.enumerated.name; 1852 1851 count = uinfo->value.enumerated.item; 1853 1852 1854 1853 ret = aw88399_dev_get_prof_name(aw88399->aw_pa, count, &prof_name); 1855 1854 if (ret) { 1856 - strscpy(uinfo->value.enumerated.name, "null", 1857 - strlen("null") + 1); 1855 + strscpy(uinfo->value.enumerated.name, "null"); 1858 1856 return 0; 1859 1857 } 1860 1858 1861 - strscpy(name, prof_name, sizeof(uinfo->value.enumerated.name)); 1859 + strscpy(uinfo->value.enumerated.name, prof_name); 1862 1860 1863 1861 return 0; 1864 1862 }
+1 -1
sound/soc/codecs/lpass-tx-macro.c
··· 2229 2229 } 2230 2230 2231 2231 static const struct snd_soc_component_driver tx_macro_component_drv = { 2232 - .name = "RX-MACRO", 2232 + .name = "TX-MACRO", 2233 2233 .probe = tx_macro_component_probe, 2234 2234 .controls = tx_macro_snd_controls, 2235 2235 .num_controls = ARRAY_SIZE(tx_macro_snd_controls),
+2 -1
sound/soc/codecs/rt1320-sdw.c
··· 109 109 { 0x0000d540, 0x01 }, 110 110 { 0xd172, 0x2a }, 111 111 { 0xc5d6, 0x01 }, 112 + { 0xd478, 0xff }, 112 113 }; 113 114 114 115 static const struct reg_sequence rt1320_vc_blind_write[] = { ··· 160 159 { 0xd471, 0x3a }, 161 160 { 0xd474, 0x11 }, 162 161 { 0xd475, 0x32 }, 163 - { 0xd478, 0x64 }, 162 + { 0xd478, 0xff }, 164 163 { 0xd479, 0x20 }, 165 164 { 0xd47a, 0x10 }, 166 165 { 0xd47c, 0xff },
+2
sound/soc/codecs/rt721-sdca.c
··· 278 278 RT721_ENT_FLOAT_CTL1, 0x4040); 279 279 rt_sdca_index_write(rt721->mbq_regmap, RT721_HDA_SDCA_FLOAT, 280 280 RT721_ENT_FLOAT_CTL4, 0x1201); 281 + rt_sdca_index_write(rt721->mbq_regmap, RT721_BOOST_CTRL, 282 + RT721_BST_4CH_TOP_GATING_CTRL1, 0x002a); 281 283 regmap_write(rt721->regmap, 0x2f58, 0x07); 282 284 } 283 285
+4
sound/soc/codecs/rt721-sdca.h
··· 56 56 #define RT721_CBJ_CTRL 0x0a 57 57 #define RT721_CAP_PORT_CTRL 0x0c 58 58 #define RT721_CLASD_AMP_CTRL 0x0d 59 + #define RT721_BOOST_CTRL 0x0f 59 60 #define RT721_VENDOR_REG 0x20 60 61 #define RT721_RC_CALIB_CTRL 0x40 61 62 #define RT721_VENDOR_EQ_L 0x53 ··· 93 92 94 93 /* Index (NID:0dh) */ 95 94 #define RT721_CLASD_AMP_2CH_CAL 0x14 95 + 96 + /* Index (NID:0fh) */ 97 + #define RT721_BST_4CH_TOP_GATING_CTRL1 0x05 96 98 97 99 /* Index (NID:20h) */ 98 100 #define RT721_JD_PRODUCT_NUM 0x00
+1 -1
sound/soc/codecs/sma1307.c
··· 1749 1749 sma1307->set.header_size * sizeof(int)); 1750 1750 1751 1751 if ((sma1307->set.checksum >> 8) != SMA1307_SETTING_CHECKSUM) { 1752 - dev_err(sma1307->dev, "%s: failed by dismatch \"%s\"\n", 1752 + dev_err(sma1307->dev, "%s: checksum failed \"%s\"\n", 1753 1753 __func__, setting_file); 1754 1754 sma1307->set.status = false; 1755 1755 return;
+3 -3
sound/soc/codecs/tas2781-i2c.c
··· 908 908 }; 909 909 910 910 static const struct snd_kcontrol_new tas2781_snd_controls[] = { 911 - SOC_SINGLE_RANGE_EXT_TLV("Speaker Analog Gain", TAS2781_AMP_LEVEL, 911 + SOC_SINGLE_RANGE_EXT_TLV("Speaker Analog Volume", TAS2781_AMP_LEVEL, 912 912 1, 0, 20, 0, tas2781_amp_getvol, 913 913 tas2781_amp_putvol, amp_vol_tlv), 914 - SOC_SINGLE_RANGE_EXT_TLV("Speaker Digital Gain", TAS2781_DVC_LVL, 914 + SOC_SINGLE_RANGE_EXT_TLV("Speaker Digital Volume", TAS2781_DVC_LVL, 915 915 0, 0, 200, 1, tas2781_digital_getvol, 916 916 tas2781_digital_putvol, dvc_tlv), 917 917 }; ··· 1480 1480 return PTR_ERR(src); 1481 1481 1482 1482 if (src[0] > max_pkg_len && src[0] != count) { 1483 - dev_err(priv->dev, "pkg(%u), max(%u), count(%u) dismatch.\n", 1483 + dev_err(priv->dev, "pkg(%u), max(%u), count(%u) mismatch.\n", 1484 1484 src[0], max_pkg_len, (unsigned int)count); 1485 1485 ret = 0; 1486 1486 goto exit;
+10 -10
sound/soc/fsl/fsl_sai.c
··· 809 809 * are running concurrently. 810 810 */ 811 811 /* Software Reset */ 812 - regmap_write(sai->regmap, FSL_SAI_xCSR(tx, ofs), FSL_SAI_CSR_SR); 812 + regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs), FSL_SAI_CSR_SR, FSL_SAI_CSR_SR); 813 813 /* Clear SR bit to finish the reset */ 814 - regmap_write(sai->regmap, FSL_SAI_xCSR(tx, ofs), 0); 814 + regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx, ofs), FSL_SAI_CSR_SR, 0); 815 815 } 816 816 817 817 static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, ··· 930 930 unsigned int ofs = sai->soc_data->reg_offset; 931 931 932 932 /* Software Reset for both Tx and Rx */ 933 - regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR); 934 - regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR); 933 + regmap_update_bits(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR, FSL_SAI_CSR_SR); 934 + regmap_update_bits(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR, FSL_SAI_CSR_SR); 935 935 /* Clear SR bit to finish the reset */ 936 - regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), 0); 937 - regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), 0); 936 + regmap_update_bits(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR, 0); 937 + regmap_update_bits(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR, 0); 938 938 939 939 regmap_update_bits(sai->regmap, FSL_SAI_TCR1(ofs), 940 940 FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth), ··· 1824 1824 1825 1825 regcache_cache_only(sai->regmap, false); 1826 1826 regcache_mark_dirty(sai->regmap); 1827 - regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR); 1828 - regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR); 1827 + regmap_update_bits(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR, FSL_SAI_CSR_SR); 1828 + regmap_update_bits(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR, FSL_SAI_CSR_SR); 1829 1829 usleep_range(1000, 2000); 1830 - regmap_write(sai->regmap, FSL_SAI_TCSR(ofs), 0); 1831 - regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), 0); 1830 + regmap_update_bits(sai->regmap, FSL_SAI_TCSR(ofs), FSL_SAI_CSR_SR, 0); 1831 + regmap_update_bits(sai->regmap, FSL_SAI_RCSR(ofs), FSL_SAI_CSR_SR, 0); 1832 1832 1833 1833 ret = regcache_sync(sai->regmap); 1834 1834 if (ret)
+2 -5
sound/soc/stm/stm32_i2s.c
··· 469 469 int ret; 470 470 471 471 ret = stm32_i2s_calc_clk_div(i2s, req->best_parent_rate, req->rate); 472 - if (ret) { 473 - req->rate = ret; 474 - 475 - return 0; 476 - } 472 + if (ret) 473 + return ret; 477 474 478 475 mclk->freq = req->best_parent_rate / i2s->divider; 479 476
+22 -3
sound/usb/stream.c
··· 341 341 342 342 len = le16_to_cpu(cluster->wLength); 343 343 c = 0; 344 - p += sizeof(struct uac3_cluster_header_descriptor); 344 + p += sizeof(*cluster); 345 + len -= sizeof(*cluster); 345 346 346 - while (((p - (void *)cluster) < len) && (c < channels)) { 347 + while (len > 0 && (c < channels)) { 347 348 struct uac3_cluster_segment_descriptor *cs_desc = p; 348 349 u16 cs_len; 349 350 u8 cs_type; 350 351 352 + if (len < sizeof(*p)) 353 + break; 351 354 cs_len = le16_to_cpu(cs_desc->wLength); 355 + if (len < cs_len) 356 + break; 352 357 cs_type = cs_desc->bSegmentType; 353 358 354 359 if (cs_type == UAC3_CHANNEL_INFORMATION) { 355 360 struct uac3_cluster_information_segment_descriptor *is = p; 356 361 unsigned char map; 362 + 363 + if (cs_len < sizeof(*is)) 364 + break; 357 365 358 366 /* 359 367 * TODO: this conversion is not complete, update it ··· 464 456 chmap->map[c++] = map; 465 457 } 466 458 p += cs_len; 459 + len -= cs_len; 467 460 } 468 461 469 462 if (channels < c) ··· 890 881 u64 badd_formats = 0; 891 882 unsigned int num_channels; 892 883 struct audioformat *fp; 893 - u16 cluster_id, wLength; 884 + u16 cluster_id, wLength, cluster_wLength; 894 885 int clock = 0; 895 886 int err; 896 887 ··· 1015 1006 } else if (err != wLength) { 1016 1007 dev_err(&dev->dev, 1017 1008 "%u:%d : can't get Cluster Descriptor\n", 1009 + iface_no, altno); 1010 + kfree(cluster); 1011 + return ERR_PTR(-EIO); 1012 + } 1013 + 1014 + cluster_wLength = le16_to_cpu(cluster->wLength); 1015 + if (cluster_wLength < sizeof(*cluster) || 1016 + cluster_wLength > wLength) { 1017 + dev_err(&dev->dev, 1018 + "%u:%d : invalid Cluster Descriptor size\n", 1018 1019 iface_no, altno); 1019 1020 kfree(cluster); 1020 1021 return ERR_PTR(-EIO);
+12
sound/usb/validate.c
··· 221 221 return d->bLength >= sizeof(*d) + 4 + 2; 222 222 } 223 223 224 + static bool validate_uac3_power_domain_unit(const void *p, 225 + const struct usb_desc_validator *v) 226 + { 227 + const struct uac3_power_domain_descriptor *d = p; 228 + 229 + if (d->bLength < sizeof(*d)) 230 + return false; 231 + /* baEntities[] + wPDomainDescrStr */ 232 + return d->bLength >= sizeof(*d) + d->bNrEntities + 2; 233 + } 234 + 224 235 static bool validate_midi_out_jack(const void *p, 225 236 const struct usb_desc_validator *v) 226 237 { ··· 296 285 struct uac3_clock_multiplier_descriptor), 297 286 /* UAC_VERSION_3, UAC3_SAMPLE_RATE_CONVERTER: not implemented yet */ 298 287 /* UAC_VERSION_3, UAC3_CONNECTORS: not implemented yet */ 288 + FUNC(UAC_VERSION_3, UAC3_POWER_DOMAIN, validate_uac3_power_domain_unit), 299 289 { } /* terminator */ 300 290 }; 301 291