Re: [PATCH net] mpls: find_outdev: check for err ptr in addition to NULL check

2016-04-08 Thread David Miller
From: Roopa Prabhu Date: Thu, 7 Apr 2016 21:28:38 -0700 > From: Roopa Prabhu > > find_outdev calls inet{,6}_fib_lookup_dev() or dev_get_by_index() to > find the output device. In case of an error, inet{,6}_fib_lookup_dev() > returns error pointer and dev_get_by_index() returns NULL. But the fu

[PATCH net] mpls: find_outdev: check for err ptr in addition to NULL check

2016-04-07 Thread Roopa Prabhu
From: Roopa Prabhu find_outdev calls inet{,6}_fib_lookup_dev() or dev_get_by_index() to find the output device. In case of an error, inet{,6}_fib_lookup_dev() returns error pointer and dev_get_by_index() returns NULL. But the function only checks for NULL and thus can end up calling dev_put on an