Re: [PATCH net] net: ipmr: ipmr_get_table() returns NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/07/17 10:56, Dan Carpenter wrote:
> The ipmr_get_table() function doesn't return error pointers it returns
> NULL on error.
> 
> Fixes: 4f75ba6982bc ("net: ipmr: Add ipmr_rtm_getroute")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
> index bb909f1d7537..06863ea3fc5b 100644
> --- a/net/ipv4/ipmr.c
> +++ b/net/ipv4/ipmr.c
> @@ -2431,8 +2431,8 @@ static int ipmr_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
>  	tableid = tb[RTA_TABLE] ? nla_get_u32(tb[RTA_TABLE]) : 0;
>  
>  	mrt = ipmr_get_table(net, tableid ? tableid : RT_TABLE_DEFAULT);
> -	if (IS_ERR(mrt)) {
> -		err = PTR_ERR(mrt);
> +	if (!mrt) {
> +		err = -ENOENT;
>  		goto errout_free;
>  	}
>  
> 

Good catch, ipmr_new_table() is the one that can return err ptr.

Acked-by: Nikolay Aleksandrov <nikolay@xxxxxxxxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux