提交 a33279df 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

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: NDan Carpenter <error27@gmail.com>
Acked-by: NYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 fb34d537
...@@ -822,8 +822,6 @@ static void force_dequeue(struct r8a66597 *r8a66597, u16 pipenum, u16 address) ...@@ -822,8 +822,6 @@ static void force_dequeue(struct r8a66597 *r8a66597, u16 pipenum, u16 address)
return; return;
list_for_each_entry_safe(td, next, list, queue) { list_for_each_entry_safe(td, next, list, queue) {
if (!td)
continue;
if (td->address != address) if (td->address != address)
continue; continue;
...@@ -2025,8 +2023,6 @@ static struct r8a66597_device *get_r8a66597_device(struct r8a66597 *r8a66597, ...@@ -2025,8 +2023,6 @@ static struct r8a66597_device *get_r8a66597_device(struct r8a66597 *r8a66597,
struct list_head *list = &r8a66597->child_device; struct list_head *list = &r8a66597->child_device;
list_for_each_entry(dev, list, device_list) { list_for_each_entry(dev, list, device_list) {
if (!dev)
continue;
if (dev->usb_address != addr) if (dev->usb_address != addr)
continue; continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册