All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NOUPSTREAM: ANDROID: usb: gadget: configfs: fix itnull.cocci warnings (fwd)
@ 2021-12-10 22:25 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2021-12-10 22:25 UTC (permalink / raw)
  To: kbuild-all

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

Hello,

The patch with the call to BAD is a Coccinelle hack, but it remains the
case that fi cannot be NULL in the first line of the body of the
list_for_each loop.

julia

---------- Forwarded message ----------
Date: Tue, 7 Dec 2021 18:50:38 +0800
From: kernel test robot <lkp@intel.com>
To: kbuild(a)lists.01.org
Cc: lkp(a)intel.com, Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH] NOUPSTREAM: ANDROID: usb: gadget: configfs: fix itnull.cocci
    warnings

CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com
TO: Guenter Roeck <groeck@google.com>

From: kernel test robot <lkp@intel.com>

drivers/usb/gadget/configfs.c:1554:6-8: ERROR: iterator variable bound on line 1553 cannot be NULL

 Many iterators have the property that the first argument is always bound
 to a real list element, never NULL.

Semantic patch information:
 False positives arise for some iterators that do not have this property,
 or in cases when the loop cursor is reassigned.  The latter should only
 happen when the matched code is on the way to a loop exit (break, goto,
 or return).

Generated by: scripts/coccinelle/iterators/itnull.cocci

CC: Badhri Jagan Sridharan <Badhri@google.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.15
head:   617fec3654adc5dfc39d303b5b371fc4e1be600b
commit: db87c70afb233e6f6c5fb8164f92b1bef4690a1b [1992/2561] NOUPSTREAM: ANDROID: usb: gadget: configfs: Add Uevent to notify userspace
:::::: branch date: 8 hours ago
:::::: commit date: 2 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 configfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1551,7 +1551,7 @@ static int android_setup(struct usb_gadg
 	}
 	spin_unlock_irqrestore(&cdev->lock, flags);
 	list_for_each_entry(fi, &gi->available_func, cfs_list) {
-		if (fi != NULL && fi->f != NULL && fi->f->setup != NULL) {
+		if (BAD(fi != NULL) && fi->f != NULL && fi->f->setup != NULL) {
 			value = fi->f->setup(fi->f, c);
 			if (value >= 0)
 				break;

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

only message in thread, other threads:[~2021-12-10 22:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 22:25 [PATCH] NOUPSTREAM: ANDROID: usb: gadget: configfs: fix itnull.cocci warnings (fwd) Julia Lawall

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.