From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: [android-common:android12-5.4 8477/13064] sound/usb/pcm.c:1033 snd_usb_pcm_prepare() warn: variable dereferenced before check 'subs->cur_audiofmt' (see line 1029)
Date: Tue, 05 Jan 2021 14:48:10 +0300 [thread overview]
Message-ID: <20210105114809.GZ2809@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 2773 bytes --]
tree: https://android.googlesource.com/kernel/common android12-5.4
head: b69d75c07de5c55d7a85312132f8544bbf2f3561
commit: fd98495a63a8e99ae4b6802b73295ef997684d73 [8477/13064] ANDROID: sound: usb: Add vendor's hooking interface
config: x86_64-randconfig-m001-20201227 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 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>
New smatch warnings:
sound/usb/pcm.c:1033 snd_usb_pcm_prepare() warn: variable dereferenced before check 'subs->cur_audiofmt' (see line 1029)
Old smatch warnings:
sound/usb/pcm.c:787 configure_sync_endpoint() warn: variable dereferenced before check 'subs->stream' (see line 784)
vim +1033 sound/usb/pcm.c
e5779998bf8b70e Daniel Mack 2010-03-04 1021 static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream)
e5779998bf8b70e Daniel Mack 2010-03-04 1022 {
e5779998bf8b70e Daniel Mack 2010-03-04 1023 struct snd_pcm_runtime *runtime = substream->runtime;
e5779998bf8b70e Daniel Mack 2010-03-04 1024 struct snd_usb_substream *subs = runtime->private_data;
61a709504b07911 Dylan Reid 2012-09-18 1025 struct usb_host_interface *alts;
61a709504b07911 Dylan Reid 2012-09-18 1026 struct usb_interface *iface;
61a709504b07911 Dylan Reid 2012-09-18 1027 int ret;
e5779998bf8b70e Daniel Mack 2010-03-04 1028
fd98495a63a8e99 JaeHun Jung 2020-05-26 @1029 ret = snd_vendor_set_pcm_buf(subs->dev, subs->cur_audiofmt->iface);
^^^^^^^^^^^^^^^^^^^^^^^^^
New dereference
fd98495a63a8e99 JaeHun Jung 2020-05-26 1030 if (ret)
fd98495a63a8e99 JaeHun Jung 2020-05-26 1031 return ret;
fd98495a63a8e99 JaeHun Jung 2020-05-26 1032
e5779998bf8b70e Daniel Mack 2010-03-04 @1033 if (! subs->cur_audiofmt) {
^^^^^^^^^^^^^^^^^^^^
Check too late.
0ba41d917eeb87f Takashi Iwai 2014-02-26 1034 dev_err(&subs->dev->dev, "no format is specified!\n");
e5779998bf8b70e Daniel Mack 2010-03-04 1035 return -ENXIO;
e5779998bf8b70e Daniel Mack 2010-03-04 1036 }
e5779998bf8b70e Daniel Mack 2010-03-04 1037
47ab154593827b1 Takashi Iwai 2015-08-25 1038 ret = snd_usb_lock_shutdown(subs->stream->chip);
47ab154593827b1 Takashi Iwai 2015-08-25 1039 if (ret < 0)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36698 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [android-common:android12-5.4 8477/13064] sound/usb/pcm.c:1033 snd_usb_pcm_prepare() warn: variable dereferenced before check 'subs->cur_audiofmt' (see line 1029)
Date: Tue, 05 Jan 2021 14:48:10 +0300 [thread overview]
Message-ID: <20210105114809.GZ2809@kadam> (raw)
[-- Attachment #1: Type: text/plain, Size: 2773 bytes --]
tree: https://android.googlesource.com/kernel/common android12-5.4
head: b69d75c07de5c55d7a85312132f8544bbf2f3561
commit: fd98495a63a8e99ae4b6802b73295ef997684d73 [8477/13064] ANDROID: sound: usb: Add vendor's hooking interface
config: x86_64-randconfig-m001-20201227 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 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>
New smatch warnings:
sound/usb/pcm.c:1033 snd_usb_pcm_prepare() warn: variable dereferenced before check 'subs->cur_audiofmt' (see line 1029)
Old smatch warnings:
sound/usb/pcm.c:787 configure_sync_endpoint() warn: variable dereferenced before check 'subs->stream' (see line 784)
vim +1033 sound/usb/pcm.c
e5779998bf8b70e Daniel Mack 2010-03-04 1021 static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream)
e5779998bf8b70e Daniel Mack 2010-03-04 1022 {
e5779998bf8b70e Daniel Mack 2010-03-04 1023 struct snd_pcm_runtime *runtime = substream->runtime;
e5779998bf8b70e Daniel Mack 2010-03-04 1024 struct snd_usb_substream *subs = runtime->private_data;
61a709504b07911 Dylan Reid 2012-09-18 1025 struct usb_host_interface *alts;
61a709504b07911 Dylan Reid 2012-09-18 1026 struct usb_interface *iface;
61a709504b07911 Dylan Reid 2012-09-18 1027 int ret;
e5779998bf8b70e Daniel Mack 2010-03-04 1028
fd98495a63a8e99 JaeHun Jung 2020-05-26 @1029 ret = snd_vendor_set_pcm_buf(subs->dev, subs->cur_audiofmt->iface);
^^^^^^^^^^^^^^^^^^^^^^^^^
New dereference
fd98495a63a8e99 JaeHun Jung 2020-05-26 1030 if (ret)
fd98495a63a8e99 JaeHun Jung 2020-05-26 1031 return ret;
fd98495a63a8e99 JaeHun Jung 2020-05-26 1032
e5779998bf8b70e Daniel Mack 2010-03-04 @1033 if (! subs->cur_audiofmt) {
^^^^^^^^^^^^^^^^^^^^
Check too late.
0ba41d917eeb87f Takashi Iwai 2014-02-26 1034 dev_err(&subs->dev->dev, "no format is specified!\n");
e5779998bf8b70e Daniel Mack 2010-03-04 1035 return -ENXIO;
e5779998bf8b70e Daniel Mack 2010-03-04 1036 }
e5779998bf8b70e Daniel Mack 2010-03-04 1037
47ab154593827b1 Takashi Iwai 2015-08-25 1038 ret = snd_usb_lock_shutdown(subs->stream->chip);
47ab154593827b1 Takashi Iwai 2015-08-25 1039 if (ret < 0)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36698 bytes --]
next reply other threads:[~2021-01-05 11:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 11:48 Dan Carpenter [this message]
2021-01-05 11:48 ` [android-common:android12-5.4 8477/13064] sound/usb/pcm.c:1033 snd_usb_pcm_prepare() warn: variable dereferenced before check 'subs->cur_audiofmt' (see line 1029) Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2020-12-27 22:01 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=20210105114809.GZ2809@kadam \
--to=dan.carpenter@oracle.com \
--cc=kbuild@lists.01.org \
/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.