* [linux-next:master 6518/7247] sound/pci/echoaudio/echoaudio.c:730 pcm_prepare() warn: inconsistent returns 'irq'.
@ 2020-07-12 13:31 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-07-12 13:31 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 6039 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Mark Hills <mark@xwax.org>
CC: Takashi Iwai <tiwai@suse.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: d31958b30ea3b7b6e522d6bf449427748ad45822
commit: 6c331254487306a633a3d8636ca78eb77a73906a [6518/7247] ALSA: echoaudio: Prevent races in calls to set_audio_format()
:::::: branch date: 2 days ago
:::::: commit date: 3 days ago
config: i386-randconfig-m021-20200712 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
sound/pci/echoaudio/echoaudio.c:730 pcm_prepare() warn: inconsistent returns 'irq'.
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=6c331254487306a633a3d8636ca78eb77a73906a
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 6c331254487306a633a3d8636ca78eb77a73906a
vim +/irq +730 sound/pci/echoaudio/echoaudio.c
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 674
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 675
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 676
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 677 static int pcm_prepare(struct snd_pcm_substream *substream)
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 678 {
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 679 struct echoaudio *chip = snd_pcm_substream_chip(substream);
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 680 struct snd_pcm_runtime *runtime = substream->runtime;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 681 struct audioformat format;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 682 int pipe_index = ((struct audiopipe *)runtime->private_data)->index;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 683
b5b4a41b392960 Sudip Mukherjee 2014-11-03 684 dev_dbg(chip->card->dev, "Prepare rate=%d format=%d channels=%d\n",
b5b4a41b392960 Sudip Mukherjee 2014-11-03 685 runtime->rate, runtime->format, runtime->channels);
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 686 format.interleave = runtime->channels;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 687 format.data_are_bigendian = 0;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 688 format.mono_to_stereo = 0;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 689 switch (runtime->format) {
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 690 case SNDRV_PCM_FORMAT_U8:
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 691 format.bits_per_sample = 8;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 692 break;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 693 case SNDRV_PCM_FORMAT_S16_LE:
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 694 format.bits_per_sample = 16;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 695 break;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 696 case SNDRV_PCM_FORMAT_S24_3LE:
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 697 format.bits_per_sample = 24;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 698 break;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 699 case SNDRV_PCM_FORMAT_S32_BE:
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 700 format.data_are_bigendian = 1;
ef0075280cfe09 Gustavo A. R. Silva 2018-08-04 701 /* fall through */
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 702 case SNDRV_PCM_FORMAT_S32_LE:
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 703 format.bits_per_sample = 32;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 704 break;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 705 default:
b5b4a41b392960 Sudip Mukherjee 2014-11-03 706 dev_err(chip->card->dev,
b5b4a41b392960 Sudip Mukherjee 2014-11-03 707 "Prepare error: unsupported format %d\n",
b5b4a41b392960 Sudip Mukherjee 2014-11-03 708 runtime->format);
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 709 return -EINVAL;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 710 }
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 711
da3cec35dd3c31 Takashi Iwai 2008-08-08 712 if (snd_BUG_ON(pipe_index >= px_num(chip)))
da3cec35dd3c31 Takashi Iwai 2008-08-08 713 return -EINVAL;
6c331254487306 Mark Hills 2020-07-08 714
6c331254487306 Mark Hills 2020-07-08 715 /*
6c331254487306 Mark Hills 2020-07-08 716 * We passed checks we can do independently; now take
6c331254487306 Mark Hills 2020-07-08 717 * exclusive control
6c331254487306 Mark Hills 2020-07-08 718 */
6c331254487306 Mark Hills 2020-07-08 719
6c331254487306 Mark Hills 2020-07-08 720 spin_lock_irq(&chip->lock);
6c331254487306 Mark Hills 2020-07-08 721
6c331254487306 Mark Hills 2020-07-08 722 if (snd_BUG_ON(!is_pipe_allocated(chip, pipe_index))) {
6c331254487306 Mark Hills 2020-07-08 723 spin_unlock(&chip->lock);
da3cec35dd3c31 Takashi Iwai 2008-08-08 724 return -EINVAL;
6c331254487306 Mark Hills 2020-07-08 725 }
6c331254487306 Mark Hills 2020-07-08 726
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 727 set_audio_format(chip, pipe_index, &format);
6c331254487306 Mark Hills 2020-07-08 728 spin_unlock_irq(&chip->lock);
6c331254487306 Mark Hills 2020-07-08 729
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 @730 return 0;
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 731 }
dd7b254d8dd3a9 Giuliano Pochini 2006-06-28 732
:::::: The code at line 730 was first introduced by commit
:::::: dd7b254d8dd3a9528f423ac3bf875e6f0c8da561 [ALSA] Add echoaudio sound drivers
:::::: TO: Giuliano Pochini <pochini@shiny.it>
:::::: CC: Jaroslav Kysela <perex@suse.cz>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39801 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-07-12 13:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-12 13:31 [linux-next:master 6518/7247] sound/pci/echoaudio/echoaudio.c:730 pcm_prepare() warn: inconsistent returns 'irq' kernel test robot
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.