[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALs4sv3AMNVVX9-ay--ZYizm6M2aY596kF+uF5M-Z3uLp=YwFQ@mail.gmail.com>
Date: Fri, 16 Jun 2023 15:43:41 +0530
From: Pavan Chebbi <pavan.chebbi@...adcom.com>
To: Lin Ma <linma@....edu.cn>
Cc: jk@...econstruct.com.au, matt@...econstruct.com.au, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v1] net: mctp: remove redundant RTN_UNICAST check
On Thu, Jun 15, 2023 at 8:53 PM Lin Ma <linma@....edu.cn> wrote:
>
> 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.
>
> Fixes: 83f0a0b7285b ("mctp: Specify route types, require rtm_type in RTM_*ROUTE messages")
> Signed-off-by: Lin Ma <linma@....edu.cn>
> ---
Reviewed-by: Pavan Chebbi <pavan.chebbi@...adcom.com>
> net/mctp/route.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/net/mctp/route.c b/net/mctp/route.c
> index f51a05ec7162..ab62fe447038 100644
> --- a/net/mctp/route.c
> +++ b/net/mctp/route.c
> @@ -1249,9 +1249,6 @@ static int mctp_newroute(struct sk_buff *skb, struct nlmsghdr *nlh,
> mtu = nla_get_u32(tbx[RTAX_MTU]);
> }
>
> - if (rtm->rtm_type != RTN_UNICAST)
> - return -EINVAL;
> -
> rc = mctp_route_add(mdev, daddr_start, rtm->rtm_dst_len, mtu,
> rtm->rtm_type);
> return rc;
> --
> 2.17.1
>
>
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)
Powered by blists - more mailing lists