All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/usb/gadget/legacy/raw_gadget.c:102 raw_event_queue_fetch() warn: inconsistent returns 'queue->sema'.
@ 2020-06-02  6:08 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-06-02  6:08 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4073 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Andrey, Konovalov," <andreyknvl@google.com>
CC: Felipe Balbi <balbi@kernel.org>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>

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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36880 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-02  6:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02  6:08 drivers/usb/gadget/legacy/raw_gadget.c:102 raw_event_queue_fetch() warn: inconsistent returns 'queue->sema' kbuild test robot

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.