:::::: :::::: Manual check reason: "low confidence bisect report" :::::: Manual check reason: "low confidence static check warning: drivers/gnss/usb.c:120:41: warning: use of uninitialized value '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]" ::::::
BCC: [email protected] CC: [email protected] CC: [email protected] TO: Johan Hovold <[email protected]> CC: "Greg Kroah-Hartman" <[email protected]> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: b96fbd602d35739b5cdb49baa02048f2c41fdab1 commit: ee4736e50ba261944ddae75469b3eb47a9e2847d gnss: add USB support date: 9 months ago :::::: branch date: 30 hours ago :::::: commit date: 9 months ago config: arm-randconfig-c002-20220906 (https://download.01.org/0day-ci/archive/20220912/[email protected]/config) compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ee4736e50ba261944ddae75469b3eb47a9e2847d git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout ee4736e50ba261944ddae75469b3eb47a9e2847d # save the config file COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error' If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <[email protected]> gcc_analyzer warnings: (new ones prefixed by >>) drivers/gnss/usb.c: In function 'gnss_usb_probe': >> drivers/gnss/usb.c:120:41: warning: use of uninitialized value '<unknown>' >> [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 120 | struct usb_endpoint_descriptor *in, *out; | ^~ 'gnss_usb_probe': event 1 | | 120 | struct usb_endpoint_descriptor *in, *out; | | ^~ | | | | | (1) use of uninitialized value '<unknown>' here | drivers/gnss/usb.c:120:46: warning: use of uninitialized value '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 120 | struct usb_endpoint_descriptor *in, *out; | ^~~ 'gnss_usb_probe': event 1 | | 120 | struct usb_endpoint_descriptor *in, *out; | | ^~~ | | | | | (1) use of uninitialized value '<unknown>' here | vim +120 drivers/gnss/usb.c ee4736e50ba261 Johan Hovold 2021-12-20 116 ee4736e50ba261 Johan Hovold 2021-12-20 117 static int gnss_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) ee4736e50ba261 Johan Hovold 2021-12-20 118 { ee4736e50ba261 Johan Hovold 2021-12-20 119 struct usb_device *udev = interface_to_usbdev(intf); ee4736e50ba261 Johan Hovold 2021-12-20 @120 struct usb_endpoint_descriptor *in, *out; ee4736e50ba261 Johan Hovold 2021-12-20 121 struct gnss_device *gdev; ee4736e50ba261 Johan Hovold 2021-12-20 122 struct gnss_usb *gusb; ee4736e50ba261 Johan Hovold 2021-12-20 123 struct urb *urb; ee4736e50ba261 Johan Hovold 2021-12-20 124 size_t buf_len; ee4736e50ba261 Johan Hovold 2021-12-20 125 void *buf; ee4736e50ba261 Johan Hovold 2021-12-20 126 int ret; ee4736e50ba261 Johan Hovold 2021-12-20 127 ee4736e50ba261 Johan Hovold 2021-12-20 128 ret = usb_find_common_endpoints(intf->cur_altsetting, &in, &out, NULL, ee4736e50ba261 Johan Hovold 2021-12-20 129 NULL); ee4736e50ba261 Johan Hovold 2021-12-20 130 if (ret) ee4736e50ba261 Johan Hovold 2021-12-20 131 return ret; ee4736e50ba261 Johan Hovold 2021-12-20 132 ee4736e50ba261 Johan Hovold 2021-12-20 133 gusb = kzalloc(sizeof(*gusb), GFP_KERNEL); ee4736e50ba261 Johan Hovold 2021-12-20 134 if (!gusb) ee4736e50ba261 Johan Hovold 2021-12-20 135 return -ENOMEM; ee4736e50ba261 Johan Hovold 2021-12-20 136 ee4736e50ba261 Johan Hovold 2021-12-20 137 gdev = gnss_allocate_device(&intf->dev); ee4736e50ba261 Johan Hovold 2021-12-20 138 if (!gdev) { ee4736e50ba261 Johan Hovold 2021-12-20 139 ret = -ENOMEM; ee4736e50ba261 Johan Hovold 2021-12-20 140 goto err_free_gusb; ee4736e50ba261 Johan Hovold 2021-12-20 141 } ee4736e50ba261 Johan Hovold 2021-12-20 142 ee4736e50ba261 Johan Hovold 2021-12-20 143 gdev->ops = &gnss_usb_gnss_ops; ee4736e50ba261 Johan Hovold 2021-12-20 144 gdev->type = GNSS_TYPE_NMEA; ee4736e50ba261 Johan Hovold 2021-12-20 145 gnss_set_drvdata(gdev, gusb); ee4736e50ba261 Johan Hovold 2021-12-20 146 ee4736e50ba261 Johan Hovold 2021-12-20 147 urb = usb_alloc_urb(0, GFP_KERNEL); ee4736e50ba261 Johan Hovold 2021-12-20 148 if (!urb) { ee4736e50ba261 Johan Hovold 2021-12-20 149 ret = -ENOMEM; ee4736e50ba261 Johan Hovold 2021-12-20 150 goto err_put_gdev; ee4736e50ba261 Johan Hovold 2021-12-20 151 } ee4736e50ba261 Johan Hovold 2021-12-20 152 ee4736e50ba261 Johan Hovold 2021-12-20 153 buf_len = max(usb_endpoint_maxp(in), GNSS_USB_READ_BUF_LEN); ee4736e50ba261 Johan Hovold 2021-12-20 154 ee4736e50ba261 Johan Hovold 2021-12-20 155 buf = kzalloc(buf_len, GFP_KERNEL); ee4736e50ba261 Johan Hovold 2021-12-20 156 if (!buf) { ee4736e50ba261 Johan Hovold 2021-12-20 157 ret = -ENOMEM; ee4736e50ba261 Johan Hovold 2021-12-20 158 goto err_free_urb; ee4736e50ba261 Johan Hovold 2021-12-20 159 } ee4736e50ba261 Johan Hovold 2021-12-20 160 ee4736e50ba261 Johan Hovold 2021-12-20 161 usb_fill_bulk_urb(urb, udev, ee4736e50ba261 Johan Hovold 2021-12-20 162 usb_rcvbulkpipe(udev, usb_endpoint_num(in)), ee4736e50ba261 Johan Hovold 2021-12-20 163 buf, buf_len, gnss_usb_rx_complete, gusb); ee4736e50ba261 Johan Hovold 2021-12-20 164 ee4736e50ba261 Johan Hovold 2021-12-20 165 gusb->intf = intf; ee4736e50ba261 Johan Hovold 2021-12-20 166 gusb->udev = udev; ee4736e50ba261 Johan Hovold 2021-12-20 167 gusb->gdev = gdev; ee4736e50ba261 Johan Hovold 2021-12-20 168 gusb->read_urb = urb; ee4736e50ba261 Johan Hovold 2021-12-20 169 gusb->write_pipe = usb_sndbulkpipe(udev, usb_endpoint_num(out)); ee4736e50ba261 Johan Hovold 2021-12-20 170 ee4736e50ba261 Johan Hovold 2021-12-20 171 ret = gnss_register_device(gdev); ee4736e50ba261 Johan Hovold 2021-12-20 172 if (ret) ee4736e50ba261 Johan Hovold 2021-12-20 173 goto err_free_buf; ee4736e50ba261 Johan Hovold 2021-12-20 174 ee4736e50ba261 Johan Hovold 2021-12-20 175 usb_set_intfdata(intf, gusb); ee4736e50ba261 Johan Hovold 2021-12-20 176 ee4736e50ba261 Johan Hovold 2021-12-20 177 return 0; ee4736e50ba261 Johan Hovold 2021-12-20 178 ee4736e50ba261 Johan Hovold 2021-12-20 179 err_free_buf: ee4736e50ba261 Johan Hovold 2021-12-20 180 kfree(buf); ee4736e50ba261 Johan Hovold 2021-12-20 181 err_free_urb: ee4736e50ba261 Johan Hovold 2021-12-20 182 usb_free_urb(urb); ee4736e50ba261 Johan Hovold 2021-12-20 183 err_put_gdev: ee4736e50ba261 Johan Hovold 2021-12-20 184 gnss_put_device(gdev); ee4736e50ba261 Johan Hovold 2021-12-20 185 err_free_gusb: ee4736e50ba261 Johan Hovold 2021-12-20 186 kfree(gusb); ee4736e50ba261 Johan Hovold 2021-12-20 187 ee4736e50ba261 Johan Hovold 2021-12-20 188 return ret; ee4736e50ba261 Johan Hovold 2021-12-20 189 } ee4736e50ba261 Johan Hovold 2021-12-20 190 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
