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 <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

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/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to