Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a33279df authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

USB: r8a66597: clean up. remove unneeded null checks



td and dev can not be null.

Also they are dereferenced in list_for_each_entry_safe and list_for_each
before the check happens so we would have an oops if it were possible
for them to be null.

Found using the smatch static checker.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fb34d537
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -822,8 +822,6 @@ static void force_dequeue(struct r8a66597 *r8a66597, u16 pipenum, u16 address)
		return;

	list_for_each_entry_safe(td, next, list, queue) {
		if (!td)
			continue;
		if (td->address != address)
			continue;

@@ -2025,8 +2023,6 @@ static struct r8a66597_device *get_r8a66597_device(struct r8a66597 *r8a66597,
	struct list_head *list = &r8a66597->child_device;

	list_for_each_entry(dev, list, device_list) {
		if (!dev)
			continue;
		if (dev->usb_address != addr)
			continue;