Skip to content

Commit f60ce8a

Browse files
f0rm2l1nkuba-moo
authored andcommitted
net: mctp: remove redundant RTN_UNICAST check
Current mctp_newroute() contains two exactly same check against rtm->rtm_type static int mctp_newroute(...) { ... if (rtm->rtm_type != RTN_UNICAST) { // (1) NL_SET_ERR_MSG(extack, "rtm_type must be RTN_UNICAST"); return -EINVAL; } ... if (rtm->rtm_type != RTN_UNICAST) // (2) return -EINVAL; ... } This commits removes the (2) check as it is redundant. Signed-off-by: Lin Ma <[email protected]> Reviewed-by: Pavan Chebbi <[email protected]> Acked-by: Jeremy Kerr <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6907217 commit f60ce8a

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

net/mctp/route.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,9 +1249,6 @@ static int mctp_newroute(struct sk_buff *skb, struct nlmsghdr *nlh,
12491249
mtu = nla_get_u32(tbx[RTAX_MTU]);
12501250
}
12511251

1252-
if (rtm->rtm_type != RTN_UNICAST)
1253-
return -EINVAL;
1254-
12551252
rc = mctp_route_add(mdev, daddr_start, rtm->rtm_dst_len, mtu,
12561253
rtm->rtm_type);
12571254
return rc;

0 commit comments

Comments
 (0)