All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [tiwai-sound:for-next 23/38] sound/core/pcm_compat.c:423 snd_pcm_ioctl_sync_ptr_x32() error: uninitialized symbol 'sflags'.
Date: Tue, 1 Jul 2025 10:56:21 +0800	[thread overview]
Message-ID: <202507011031.wWzbWNZP-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: alsa-devel@alsa-project.org
TO: Christophe Leroy <christophe.leroy@csgroup.eu>
CC: Takashi Iwai <tiwai@suse.de>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
head:   66b338d006d75ab52b16bf05a7f4f451043199bf
commit: a9b49bf8ad5905ebd999da345dcff3b9fad43877 [23/38] ALSA: pcm: Convert SNDRV_PCM_IOCTL_SYNC_PTR to user_access_begin/user_access_end()
:::::: branch date: 15 hours ago
:::::: commit date: 2 weeks ago
config: x86_64-randconfig-161-20250630 (https://download.01.org/0day-ci/archive/20250701/202507011031.wWzbWNZP-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0

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@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202507011031.wWzbWNZP-lkp@intel.com/

New smatch warnings:
sound/core/pcm_compat.c:423 snd_pcm_ioctl_sync_ptr_x32() error: uninitialized symbol 'sflags'.

Old smatch warnings:
sound/core/pcm_native.c:3210 snd_pcm_ioctl_sync_ptr_compat() error: uninitialized symbol 'sflags'.
sound/core/pcm_compat.c:21 snd_pcm_ioctl_delay_compat() error: uninitialized symbol 'delay'.

vim +/sflags +423 sound/core/pcm_compat.c

513ace79b657e2 Takashi Iwai     2016-02-28  405  
513ace79b657e2 Takashi Iwai     2016-02-28  406  static int snd_pcm_ioctl_sync_ptr_x32(struct snd_pcm_substream *substream,
513ace79b657e2 Takashi Iwai     2016-02-28  407  				      struct snd_pcm_sync_ptr_x32 __user *src)
513ace79b657e2 Takashi Iwai     2016-02-28  408  {
513ace79b657e2 Takashi Iwai     2016-02-28  409  	struct snd_pcm_runtime *runtime = substream->runtime;
513ace79b657e2 Takashi Iwai     2016-02-28  410  	volatile struct snd_pcm_mmap_status *status;
513ace79b657e2 Takashi Iwai     2016-02-28  411  	volatile struct snd_pcm_mmap_control *control;
513ace79b657e2 Takashi Iwai     2016-02-28  412  	u32 sflags;
513ace79b657e2 Takashi Iwai     2016-02-28  413  	struct snd_pcm_mmap_control scontrol;
513ace79b657e2 Takashi Iwai     2016-02-28  414  	struct snd_pcm_mmap_status sstatus;
513ace79b657e2 Takashi Iwai     2016-02-28  415  	snd_pcm_uframes_t boundary;
513ace79b657e2 Takashi Iwai     2016-02-28  416  	int err;
513ace79b657e2 Takashi Iwai     2016-02-28  417  
513ace79b657e2 Takashi Iwai     2016-02-28  418  	if (snd_BUG_ON(!runtime))
513ace79b657e2 Takashi Iwai     2016-02-28  419  		return -EINVAL;
513ace79b657e2 Takashi Iwai     2016-02-28  420  
2acd83beb4d3fd Christophe Leroy 2025-06-14  421  	if (snd_pcm_sync_ptr_get_user(sflags, scontrol, src))
513ace79b657e2 Takashi Iwai     2016-02-28  422  		return -EFAULT;
513ace79b657e2 Takashi Iwai     2016-02-28 @423  	if (sflags & SNDRV_PCM_SYNC_PTR_HWSYNC) {
513ace79b657e2 Takashi Iwai     2016-02-28  424  		err = snd_pcm_hwsync(substream);
513ace79b657e2 Takashi Iwai     2016-02-28  425  		if (err < 0)
513ace79b657e2 Takashi Iwai     2016-02-28  426  			return err;
513ace79b657e2 Takashi Iwai     2016-02-28  427  	}
513ace79b657e2 Takashi Iwai     2016-02-28  428  	status = runtime->status;
513ace79b657e2 Takashi Iwai     2016-02-28  429  	control = runtime->control;
513ace79b657e2 Takashi Iwai     2016-02-28  430  	boundary = recalculate_boundary(runtime);
513ace79b657e2 Takashi Iwai     2016-02-28  431  	if (!boundary)
513ace79b657e2 Takashi Iwai     2016-02-28  432  		boundary = 0x7fffffff;
650224fe8d5f6d Takashi Iwai     2024-02-27  433  	scoped_guard(pcm_stream_lock_irq, substream) {
513ace79b657e2 Takashi Iwai     2016-02-28  434  		/* FIXME: we should consider the boundary for the sync from app */
513ace79b657e2 Takashi Iwai     2016-02-28  435  		if (!(sflags & SNDRV_PCM_SYNC_PTR_APPL))
513ace79b657e2 Takashi Iwai     2016-02-28  436  			control->appl_ptr = scontrol.appl_ptr;
513ace79b657e2 Takashi Iwai     2016-02-28  437  		else
513ace79b657e2 Takashi Iwai     2016-02-28  438  			scontrol.appl_ptr = control->appl_ptr % boundary;
513ace79b657e2 Takashi Iwai     2016-02-28  439  		if (!(sflags & SNDRV_PCM_SYNC_PTR_AVAIL_MIN))
513ace79b657e2 Takashi Iwai     2016-02-28  440  			control->avail_min = scontrol.avail_min;
513ace79b657e2 Takashi Iwai     2016-02-28  441  		else
513ace79b657e2 Takashi Iwai     2016-02-28  442  			scontrol.avail_min = control->avail_min;
513ace79b657e2 Takashi Iwai     2016-02-28  443  		sstatus.state = status->state;
513ace79b657e2 Takashi Iwai     2016-02-28  444  		sstatus.hw_ptr = status->hw_ptr % boundary;
513ace79b657e2 Takashi Iwai     2016-02-28  445  		sstatus.tstamp = status->tstamp;
513ace79b657e2 Takashi Iwai     2016-02-28  446  		sstatus.suspended_state = status->suspended_state;
513ace79b657e2 Takashi Iwai     2016-02-28  447  		sstatus.audio_tstamp = status->audio_tstamp;
650224fe8d5f6d Takashi Iwai     2024-02-27  448  	}
a25684a956468e Takashi Iwai     2021-10-17  449  	if (!(sflags & SNDRV_PCM_SYNC_PTR_APPL))
a25684a956468e Takashi Iwai     2021-10-17  450  		snd_pcm_dma_buffer_sync(substream, SNDRV_DMA_SYNC_DEVICE);
2acd83beb4d3fd Christophe Leroy 2025-06-14  451  	if (snd_pcm_sync_ptr_put_user(sstatus, scontrol, src))
513ace79b657e2 Takashi Iwai     2016-02-28  452  		return -EFAULT;
513ace79b657e2 Takashi Iwai     2016-02-28  453  
513ace79b657e2 Takashi Iwai     2016-02-28  454  	return 0;
513ace79b657e2 Takashi Iwai     2016-02-28  455  }
83a44a4f47ad20 Masahiro Yamada  2022-03-14  456  #endif /* CONFIG_X86_X32_ABI */
^1da177e4c3f41 Linus Torvalds   2005-04-16  457  

:::::: The code at line 423 was first introduced by commit
:::::: 513ace79b657e2022a592e77f24074e088681ecc ALSA: pcm: Fix ioctls for X32 ABI

:::::: TO: Takashi Iwai <tiwai@suse.de>
:::::: CC: Takashi Iwai <tiwai@suse.de>

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

                 reply	other threads:[~2025-07-01  2:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202507011031.wWzbWNZP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.