[usb:usb-testing 51/52] sound/usb/qcom/mixer_usb_offload.c:131:70: warning: 'USB Offload Playback Card Ro...' directive writing 36 bytes into a region of size 34

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
head:   c26f6731b8da887f1fb92d4654da57a19a266466
commit: b8a7c987d82f97c4a9929a395923e5a2242cdaf5 [51/52] ALSA: usb-audio: qcom: Add USB offload route kcontrol
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20250215/202502150150.d6QBeC0r-lkp@xxxxxxxxx/config)
compiler: s390-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250215/202502150150.d6QBeC0r-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502150150.d6QBeC0r-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   sound/usb/qcom/mixer_usb_offload.c: In function 'snd_usb_offload_create_ctl':
>> sound/usb/qcom/mixer_usb_offload.c:131:70: warning: 'USB Offload Playback Card Ro...' directive writing 36 bytes into a region of size 34 [-Wformat-overflow=]
     131 |                 sprintf(ctl_name, "USB Offload Playback Card Route PCM#%d",
         |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
   sound/usb/qcom/mixer_usb_offload.c:131:17: note: 'sprintf' output between 38 and 48 bytes into a destination of size 34
     131 |                 sprintf(ctl_name, "USB Offload Playback Card Route PCM#%d",
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     132 |                         as->pcm_index);
         |                         ~~~~~~~~~~~~~~
>> sound/usb/qcom/mixer_usb_offload.c:147:70: warning: 'USB Offload Playback PCM Rou...' directive writing 35 bytes into a region of size 34 [-Wformat-overflow=]
     147 |                 sprintf(ctl_name, "USB Offload Playback PCM Route PCM#%d",
         |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
   sound/usb/qcom/mixer_usb_offload.c:147:17: note: 'sprintf' output between 37 and 47 bytes into a destination of size 34
     147 |                 sprintf(ctl_name, "USB Offload Playback PCM Route PCM#%d",
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     148 |                         as->pcm_index);
         |                         ~~~~~~~~~~~~~~


vim +131 sound/usb/qcom/mixer_usb_offload.c

   100	
   101	/**
   102	 * snd_usb_offload_create_ctl() - Add USB offload bounded mixer
   103	 * @chip: USB SND chip device
   104	 *
   105	 * Creates a sound control for a USB audio device, so that applications can
   106	 * query for if there is an available USB audio offload path, and which
   107	 * card is managing it.
   108	 */
   109	int snd_usb_offload_create_ctl(struct snd_usb_audio *chip)
   110	{
   111		struct usb_device *udev = chip->dev;
   112		struct snd_kcontrol_new *chip_kctl;
   113		struct snd_usb_substream *subs;
   114		struct snd_usb_stream *as;
   115		char ctl_name[34];
   116		int ret;
   117	
   118		list_for_each_entry(as, &chip->pcm_list, list) {
   119			subs = &as->substream[SNDRV_PCM_STREAM_PLAYBACK];
   120			if (!subs->ep_num || as->pcm_index > 0xff)
   121				continue;
   122	
   123			chip_kctl = &snd_usb_offload_mapped_card_ctl;
   124			chip_kctl->count = 1;
   125			/*
   126			 * Store the associated USB SND card number and PCM index for
   127			 * the kctl.
   128			 */
   129			chip_kctl->private_value = as->pcm_index |
   130						  chip->card->number << 16;
 > 131			sprintf(ctl_name, "USB Offload Playback Card Route PCM#%d",
   132				as->pcm_index);
   133			chip_kctl->name = ctl_name;
   134			ret = snd_ctl_add(chip->card, snd_ctl_new1(chip_kctl,
   135					  udev->bus->sysdev));
   136			if (ret < 0)
   137				break;
   138	
   139			chip_kctl = &snd_usb_offload_mapped_pcm_ctl;
   140			chip_kctl->count = 1;
   141			/*
   142			 * Store the associated USB SND card number and PCM index for
   143			 * the kctl.
   144			 */
   145			chip_kctl->private_value = as->pcm_index |
   146						  chip->card->number << 16;
 > 147			sprintf(ctl_name, "USB Offload Playback PCM Route PCM#%d",

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux