Sabrina Dubroca e783bb00ad ipmr: fix error path when ipmr_new_table fails
commit 0bbbf0e7d0e7 ("ipmr, ip6mr: Unite creation of new mr_table")
refactored ipmr_new_table, so that it now returns NULL when
mr_table_alloc fails. Unfortunately, all callers of ipmr_new_table
expect an ERR_PTR.

This can result in NULL deref, for example when ipmr_rules_exit calls
ipmr_free_table with NULL net->ipv4.mrt in the
!CONFIG_IP_MROUTE_MULTIPLE_TABLES version.

This patch makes mr_table_alloc return errors, and changes
ip6mr_new_table and its callers to return/expect error pointers as
well. It also removes the version of mr_table_alloc defined under
!CONFIG_IP_MROUTE_COMMON, since it is never used.

Fixes: 0bbbf0e7d0e7 ("ipmr, ip6mr: Unite creation of new mr_table")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-06-05 12:26:41 -04:00
..
2018-03-27 13:18:09 -04:00
2018-06-03 00:02:05 +02:00
2018-03-27 13:18:09 -04:00
2018-04-19 15:40:13 -04:00
2018-05-11 00:10:56 +02:00
2017-05-21 13:42:36 -04:00
2018-03-27 13:18:09 -04:00
2018-04-26 15:07:42 -04:00
2018-02-28 11:43:28 -05:00
2018-05-24 11:57:35 +02:00
2018-03-27 13:18:09 -04:00
2016-12-25 17:21:23 +01:00
2018-03-27 13:18:09 -04:00
2017-09-01 18:35:23 -07:00
2018-03-27 13:18:09 -04:00