Bladeren bron

can: fix memory leak in initial namespace support

The can_rx_alldev_list is a per-net data structure now and allocated in
can_pernet_init(). Make sure the memory is free'd in can_pernet_exit() too.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Oliver Hartkopp 8 jaren geleden
bovenliggende
commit
a7bbd28f04
1 gewijzigde bestanden met toevoegingen van 2 en 0 verwijderingen
  1. 2 0
      net/can/af_can.c

+ 2 - 0
net/can/af_can.c

@@ -903,6 +903,8 @@ static void can_pernet_exit(struct net *net)
 		}
 	}
 	rcu_read_unlock();
+
+	kfree(net->can.can_rx_alldev_list);
 }
 
 /*