net: ipmr: ipmr_get_table() returns NULL
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 12 Jul 2017 07:56:47 +0000 (10:56 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Jul 2017 15:18:46 +0000 (08:18 -0700)
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@oracle.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ipmr.c

index bb909f1d7537a9d56fc960b7932f5cc881ec6a16..06863ea3fc5b8c5582a70b14a4da9ecc67851822 100644 (file)
@@ -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;
        }