rfkill: gpio: fix memory leak in probe error path
authorJohan Hovold <johan@kernel.org>
Thu, 26 Apr 2018 07:31:52 +0000 (09:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 May 2018 08:10:26 +0000 (10:10 +0200)
commitd1d5c31fc3a53d78532216f864cb1fc4f0c7c132
treed271650694050a5bf236f48919398a1cbf11049d
parenta7ea57b025b10e09751ab18602652085eeac296e
rfkill: gpio: fix memory leak in probe error path

commit 4bf01ca21e2e0e4561d1a03c48c3d740418702db upstream.

Make sure to free the rfkill device in case registration fails during
probe.

Fixes: 5e7ca3937fbe ("net: rfkill: gpio: convert to resource managed allocation")
Cc: stable <stable@vger.kernel.org> # 3.13
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/rfkill/rfkill-gpio.c