Message ID | 1609828294-6284-1-git-send-email-wangyunjian@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v2] macvlan: remove redundant null check on data | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | warning | 1 maintainers not CCed: michael-dev@fami-braun.de |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 43 this patch: 43 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 8 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 35 this patch: 35 |
netdev/header_inline | success | Link |
netdev/stable | success | Stable not CCed |
From: wangyunjian <wangyunjian@huawei.com> Date: Tue, 5 Jan 2021 14:31:34 +0800 > From: Yunjian Wang <wangyunjian@huawei.com> > > Because macvlan_common_newlink() and macvlan_changelink() already > checked NULL data parameter, so the additional check is unnecessary, > just remove it. > > Fixes: 79cf79abce71 ("macvlan: add source mode") > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> > --- > v2: > * change code styles and commit log suggested by Jakub Kicinski > --- Applied to net-next, thanks.
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index fb51329f8964..9a9a5cf36a4b 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -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]);