CC: [email protected]
CC: [email protected]
TO: "Andrey, Konovalov," <[email protected]>
CC: Felipe Balbi <[email protected]>
CC: "Greg Kroah-Hartman" <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   f359287765c04711ff54fbd11645271d8e5ff763
commit: f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10 usb: gadget: add raw-gadget 
interface
date:   3 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 3 months ago
config: x86_64-randconfig-m001-20200602 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
drivers/usb/gadget/legacy/raw_gadget.c:102 raw_event_queue_fetch() warn: 
inconsistent returns 'queue->sema'.

Old smatch warnings:
drivers/usb/gadget/legacy/raw_gadget.c:397 raw_ioctl_init() warn: maybe return 
-EFAULT instead of the bytes remaining?
drivers/usb/gadget/legacy/raw_gadget.c:512 raw_ioctl_event_fetch() warn: maybe 
return -EFAULT instead of the bytes remaining?
drivers/usb/gadget/legacy/raw_gadget.c:535 raw_ioctl_event_fetch() warn: maybe 
return -EFAULT instead of the bytes remaining?
drivers/usb/gadget/legacy/raw_gadget.c:546 raw_alloc_io_data() error: passing 
non negative 8 to ERR_PTR
drivers/usb/gadget/legacy/raw_gadget.c:668 raw_ioctl_ep0_read() warn: maybe 
return -EFAULT instead of the bytes remaining?
drivers/usb/gadget/legacy/raw_gadget.c:962 raw_ioctl_ep_read() warn: maybe 
return -EFAULT instead of the bytes remaining?

# 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10
git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10
vim +102 drivers/usb/gadget/legacy/raw_gadget.c

f2c2e717642c66 Andrey Konovalov 2020-02-24   80  
f2c2e717642c66 Andrey Konovalov 2020-02-24   81  static struct usb_raw_event 
*raw_event_queue_fetch(
f2c2e717642c66 Andrey Konovalov 2020-02-24   82                                 
struct raw_event_queue *queue)
f2c2e717642c66 Andrey Konovalov 2020-02-24   83  {
f2c2e717642c66 Andrey Konovalov 2020-02-24   84         unsigned long flags;
f2c2e717642c66 Andrey Konovalov 2020-02-24   85         struct usb_raw_event 
*event;
f2c2e717642c66 Andrey Konovalov 2020-02-24   86  
f2c2e717642c66 Andrey Konovalov 2020-02-24   87         /*
f2c2e717642c66 Andrey Konovalov 2020-02-24   88          * This function can be 
called concurrently. We first check that
f2c2e717642c66 Andrey Konovalov 2020-02-24   89          * there's at least one 
event queued by decrementing the semaphore,
f2c2e717642c66 Andrey Konovalov 2020-02-24   90          * and then take the 
lock to protect queue struct fields.
f2c2e717642c66 Andrey Konovalov 2020-02-24   91          */
f2c2e717642c66 Andrey Konovalov 2020-02-24   92         if 
(down_interruptible(&queue->sema))
f2c2e717642c66 Andrey Konovalov 2020-02-24   93                 return NULL;
f2c2e717642c66 Andrey Konovalov 2020-02-24   94         
spin_lock_irqsave(&queue->lock, flags);
f2c2e717642c66 Andrey Konovalov 2020-02-24   95         if 
(WARN_ON(!queue->size))
f2c2e717642c66 Andrey Konovalov 2020-02-24   96                 return NULL;
f2c2e717642c66 Andrey Konovalov 2020-02-24   97         event = 
queue->events[0];
f2c2e717642c66 Andrey Konovalov 2020-02-24   98         queue->size--;
f2c2e717642c66 Andrey Konovalov 2020-02-24   99         
memmove(&queue->events[0], &queue->events[1],
f2c2e717642c66 Andrey Konovalov 2020-02-24  100                         
queue->size * sizeof(queue->events[0]));
f2c2e717642c66 Andrey Konovalov 2020-02-24  101         
spin_unlock_irqrestore(&queue->lock, flags);
f2c2e717642c66 Andrey Konovalov 2020-02-24 @102         return event;
f2c2e717642c66 Andrey Konovalov 2020-02-24  103  }
f2c2e717642c66 Andrey Konovalov 2020-02-24  104  

---
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