Skip to content

Commit

Permalink
macvlan: remove redundant null check on data
Browse files Browse the repository at this point in the history
Because macvlan_common_newlink() and macvlan_changelink() already
checked NULL data parameter, so the additional check is unnecessary,
just remove it.

Fixes: 79cf79a ("macvlan: add source mode")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yunjian Wang authored and David S. Miller committed Jan 6, 2021
1 parent 81a4362 commit 89430ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ static int macvlan_changelink_sources(struct macvlan_dev *vlan, u32 mode,
return ret;
}

if (!data || !data[IFLA_MACVLAN_MACADDR_DATA])
if (!data[IFLA_MACVLAN_MACADDR_DATA])
return 0;

head = nla_data(data[IFLA_MACVLAN_MACADDR_DATA]);
Expand Down

0 comments on commit 89430ef

Please sign in to comment.