[tiwai-sound:test/guard 44/62] sound/core/oss/mixer_oss.c:819:3: error: cannot jump from this goto statement to its label

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

 



Hi Takashi,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git test/guard
head:   e4545d528ae658c35d02593567613c06f1386ffa
commit: b398454ce784b8a931d9fe80a0c1fb9dec644d29 [44/62] ALSA: mixer_oss: Use guard() for locking
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240223/202402231259.Tx6bs1or-lkp@xxxxxxxxx/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project edd4aee4dd9b5b98b2576a6f783e4086173d902a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240223/202402231259.Tx6bs1or-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/202402231259.Tx6bs1or-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> sound/core/oss/mixer_oss.c:819:3: error: cannot jump from this goto statement to its label
     819 |                 goto error;
         |                 ^
   sound/core/oss/mixer_oss.c:821:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
     821 |         guard(rwsem_read)(&card->controls_rwsem);
         |         ^
   include/linux/cleanup.h:164:15: note: expanded from macro 'guard'
     164 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:180:29: note: expanded from macro '__UNIQUE_ID'
     180 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:36:1: note: expanded from here
      36 | __UNIQUE_ID_guard239
         | ^
   sound/core/oss/mixer_oss.c:870:3: error: cannot jump from this goto statement to its label
     870 |                 goto error;
         |                 ^
   sound/core/oss/mixer_oss.c:872:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
     872 |         guard(rwsem_read)(&card->controls_rwsem);
         |         ^
   include/linux/cleanup.h:164:15: note: expanded from macro 'guard'
     164 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:180:29: note: expanded from macro '__UNIQUE_ID'
     180 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:45:1: note: expanded from here
      45 | __UNIQUE_ID_guard240
         | ^
   2 errors generated.


vim +819 sound/core/oss/mixer_oss.c

   803	
   804	static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned int *active_index)
   805	{
   806		struct snd_card *card = fmixer->card;
   807		struct snd_mixer_oss *mixer = fmixer->mixer;
   808		struct snd_kcontrol *kctl;
   809		struct snd_mixer_oss_slot *pslot;
   810		struct slot *slot;
   811		struct snd_ctl_elem_info *uinfo;
   812		struct snd_ctl_elem_value *uctl;
   813		int err, idx;
   814		
   815		uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
   816		uctl = kzalloc(sizeof(*uctl), GFP_KERNEL);
   817		if (uinfo == NULL || uctl == NULL) {
   818			err = -ENOMEM;
 > 819			goto error;
   820		}
   821		guard(rwsem_read)(&card->controls_rwsem);
   822		kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0);
   823		if (! kctl) {
   824			err = -ENOENT;
   825			goto error;
   826		}
   827		err = kctl->info(kctl, uinfo);
   828		if (err < 0)
   829			goto error;
   830		err = kctl->get(kctl, uctl);
   831		if (err < 0)
   832			goto error;
   833		for (idx = 0; idx < 32; idx++) {
   834			if (!(mixer->mask_recsrc & (1 << idx)))
   835				continue;
   836			pslot = &mixer->slots[idx];
   837			slot = pslot->private_data;
   838			if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE)
   839				continue;
   840			if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE))
   841				continue;
   842			if (slot->capture_item == uctl->value.enumerated.item[0]) {
   843				*active_index = idx;
   844				break;
   845			}
   846		}
   847		err = 0;
   848	error:
   849	      	kfree(uctl);
   850	      	kfree(uinfo);
   851	      	return err;
   852	}
   853	

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



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux