From: Dan Carpenter <error27@gmail.com>
To: oe-kbuild@lists.linux.dev, cros-kernel-buildreports@googlegroups.com
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev
Subject: [android-common:android12-kiwi-5.10 291/291] sound/usb/pcm.c:1053 snd_usb_pcm_prepare() warn: variable dereferenced before check 'subs->cur_audiofmt' (see line 1049)
Date: Tue, 20 Oct 2026 10:07:33 +0300 [thread overview]
Message-ID: <atcTNZI9wkxpuNjM@stanley.mountain> (raw)
tree: https://android.googlesource.com/kernel/common android12-kiwi-5.10
head: aaa0cf06ed53d6805dfa9099535f6fc052c49086
commit: 1eb185541df90c3f790676b9ac362683de3519f2 [291/291] ANDROID: sound: usb: Add vendor's hooking interface
config: i386-randconfig-2200-20261020 (https://download.01.org/0day-ci/archive/20261020/202610200641.Ba5XQ2g4-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.4.0-5) 12.4.0
smatch: v0.5.0-9187-g5189e3fb
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/202610200641.Ba5XQ2g4-lkp@intel.com/
smatch warnings:
sound/usb/pcm.c:1053 snd_usb_pcm_prepare() warn: variable dereferenced before check 'subs->cur_audiofmt' (see line 1049)
vim +1053 sound/usb/pcm.c
e5779998bf8b70e Daniel Mack 2010-03-04 1041 static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream)
e5779998bf8b70e Daniel Mack 2010-03-04 1042 {
e5779998bf8b70e Daniel Mack 2010-03-04 1043 struct snd_pcm_runtime *runtime = substream->runtime;
e5779998bf8b70e Daniel Mack 2010-03-04 1044 struct snd_usb_substream *subs = runtime->private_data;
61a709504b07911 Dylan Reid 2012-09-18 1045 struct usb_host_interface *alts;
61a709504b07911 Dylan Reid 2012-09-18 1046 struct usb_interface *iface;
61a709504b07911 Dylan Reid 2012-09-18 1047 int ret;
e5779998bf8b70e Daniel Mack 2010-03-04 1048
1eb185541df90c3 JaeHun Jung 2020-05-26 @1049 ret = snd_vendor_set_pcm_buf(subs->dev, subs->cur_audiofmt->iface);
^^^^^^^^^^^^^^^^^^^^^^^^^
Android adds this vender hook
1eb185541df90c3 JaeHun Jung 2020-05-26 1050 if (ret)
1eb185541df90c3 JaeHun Jung 2020-05-26 1051 return ret;
1eb185541df90c3 JaeHun Jung 2020-05-26 1052
e5779998bf8b70e Daniel Mack 2010-03-04 @1053 if (! subs->cur_audiofmt) {
^^^^^^^^^^^^^^^^^^
before the NULL check
0ba41d917eeb87f Takashi Iwai 2014-02-26 1054 dev_err(&subs->dev->dev, "no format is specified!\n");
e5779998bf8b70e Daniel Mack 2010-03-04 1055 return -ENXIO;
e5779998bf8b70e Daniel Mack 2010-03-04 1056 }
e5779998bf8b70e Daniel Mack 2010-03-04 1057
47ab154593827b1 Takashi Iwai 2015-08-25 1058 ret = snd_usb_lock_shutdown(subs->stream->chip);
47ab154593827b1 Takashi Iwai 2015-08-25 1059 if (ret < 0)
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2026-10-20 7:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 7:07 Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-10-20 4:56 [android-common:android12-kiwi-5.10 291/291] sound/usb/pcm.c:1053 snd_usb_pcm_prepare() warn: variable dereferenced before check 'subs->cur_audiofmt' (see line 1049) kernel test robot
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=atcTNZI9wkxpuNjM@stanley.mountain \
--to=error27@gmail.com \
--cc=cros-kernel-buildreports@googlegroups.com \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--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.