linux-stable/net/mctp
Lin Ma f60ce8a48b 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 <linma@zju.edu.cn>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Acked-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20230615152240.1749428-1-linma@zju.edu.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-17 00:25:24 -07:00
..
test Networking changes for 5.19. 2022-05-25 12:22:58 -07:00
af_mctp.c mctp: remove MODULE_LICENSE in non-modules 2023-03-09 23:06:21 -08:00
device.c mctp: Remove device type check at unregister 2022-12-19 17:20:22 -08:00
Kconfig mctp: Add flow extension to skb 2021-10-29 13:23:51 +01:00
Makefile mctp: Add test utils 2021-10-03 14:35:41 +01:00
neigh.c mctp: replace mctp_address_ok with more fine-grained helpers 2022-02-18 21:24:28 -08:00
route.c net: mctp: remove redundant RTN_UNICAST check 2023-06-17 00:25:24 -07:00