···105105106106The format of the firmware file names is:107107108108-SoundWire (except CS35L56 Rev B0):108108+SoundWire:109109 cs35lxx-b0-dsp1-misc-SSID[-spkidX]-l?u?110110111111-SoundWire CS35L56 Rev B0:111111+SoundWire CS35L56 Rev B0 firmware released before kernel version 6.16:112112 cs35lxx-b0-dsp1-misc-SSID[-spkidX]-ampN113113114114Non-SoundWire (HDA and I2S):···127127 * spkidX is an optional part, used for laptops that have firmware128128 configurations for different makes and models of internal speakers.129129130130-The CS35L56 Rev B0 continues to use the old filename scheme because a131131-large number of firmware files have already been published with these132132-names.130130+Early firmware for CS35L56 Rev B0 used the ALSA prefix (ampN) as the131131+filename qualifier. Support for the l?u? qualifier was added in kernel 6.16.133132134133Sound Open Firmware and ALSA topology files135134-------------------------------------------
+1
sound/soc/codecs/cs4271.c
···603603 CS4271_MODE2_PDN | CS4271_MODE2_CPEN);604604 if (ret < 0)605605 goto err_disable_clk;606606+606607 ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2,607608 CS4271_MODE2_PDN, 0);608609 if (ret < 0)
···761761 goto out;762762 }763763764764- mutex_lock(&tas_dev->pde_lock);765764 img_sz = fmw->size;766765 buf = fmw->data;767766 offset += FW_DL_OFFSET;767767+ if (offset >= (img_sz - FW_FL_HDR)) {768768+ dev_err(tas_dev->dev,769769+ "firmware is too small");770770+ ret = -EINVAL;771771+ goto out;772772+ }773773+774774+ mutex_lock(&tas_dev->pde_lock);768775 while (offset < (img_sz - FW_FL_HDR)) {769776 memset(&hdr, 0, sizeof(hdr));770777 offset += read_header(&buf[offset], &hdr);···781774 hdr.length, offset);782775 /* size also includes the header */783776 file_blk_size = hdr.length - FW_FL_HDR;777777+778778+ /* make sure that enough data is there */779779+ if (offset + file_blk_size > img_sz) {780780+ ret = -EINVAL;781781+ dev_err(tas_dev->dev,782782+ "corrupt firmware file");783783+ break;784784+ }784785785786 switch (hdr.file_id) {786787 case 0:···822807 break;823808 }824809 mutex_unlock(&tas_dev->pde_lock);825825- tas2783_update_calibdata(tas_dev);810810+ if (!ret)811811+ tas2783_update_calibdata(tas_dev);826812827813out:828814 if (!ret)
+14-6
sound/soc/sdw_utils/soc_sdw_utils.c
···13351335 struct sdw_slave *slave;13361336 struct device *sdw_dev;13371337 const char *sdw_codec_name;13381338- int i;13381338+ int ret, i;1339133913401340 dlc = kzalloc(sizeof(*dlc), GFP_KERNEL);13411341 if (!dlc)···13651365 }1366136613671367 slave = dev_to_sdw_dev(sdw_dev);13681368- if (!slave)13691369- return -EINVAL;13681368+ if (!slave) {13691369+ ret = -EINVAL;13701370+ goto put_device;13711371+ }1370137213711373 /* Make sure BIOS provides SDCA properties */13721374 if (!slave->sdca_data.interface_revision) {13731375 dev_warn(&slave->dev, "SDCA properties not found in the BIOS\n");13741374- return 1;13761376+ ret = 1;13771377+ goto put_device;13751378 }1376137913771380 for (i = 0; i < slave->sdca_data.num_functions; i++) {···13831380 if (dai_type == dai_info->dai_type) {13841381 dev_dbg(&slave->dev, "DAI type %d sdca function %s found\n",13851382 dai_type, slave->sdca_data.function[i].name);13861386- return 1;13831383+ ret = 1;13841384+ goto put_device;13871385 }13881386 }13891387···13921388 "SDCA device function for DAI type %d not supported, skip endpoint\n",13931389 dai_info->dai_type);1394139013951395- return 0;13911391+ ret = 0;13921392+13931393+put_device:13941394+ put_device(sdw_dev);13951395+ return ret;13961396}1397139713981398int asoc_sdw_parse_sdw_endpoints(struct snd_soc_card *card,