mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
netdev: remove potentially harmful checks
Currently we're checking a variable for != NULL after actually dereferencing it, in netdev_lower_get_next_private*(). It's counter-intuitive at best, and can lead to faulty usage (as it implies that the variable can be NULL), so fix it by removing the useless checks. Reported-by: Daniel Borkmann <[email protected]> CC: "David S. Miller" <[email protected]> CC: Eric Dumazet <[email protected]> CC: Nicolas Dichtel <[email protected]> CC: Jiri Pirko <[email protected]> CC: stephen hemminger <[email protected]> CC: Jerry Chu <[email protected]> Signed-off-by: Veaceslav Falico <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
6f25cd47dc
commit
6859e7df6d
1 changed files with 2 additions and 4 deletions
|
|
@ -4589,8 +4589,7 @@ void *netdev_lower_get_next_private(struct net_device *dev,
|
|||
if (&lower->list == &dev->adj_list.lower)
|
||||
return NULL;
|
||||
|
||||
if (iter)
|
||||
*iter = lower->list.next;
|
||||
*iter = lower->list.next;
|
||||
|
||||
return lower->private;
|
||||
}
|
||||
|
|
@ -4618,8 +4617,7 @@ void *netdev_lower_get_next_private_rcu(struct net_device *dev,
|
|||
if (&lower->list == &dev->adj_list.lower)
|
||||
return NULL;
|
||||
|
||||
if (iter)
|
||||
*iter = &lower->list;
|
||||
*iter = &lower->list;
|
||||
|
||||
return lower->private;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue