rfkill: gpio: fix memory leak in probe error path
authorJohan Hovold <[email protected]>
Thu, 26 Apr 2018 07:31:52 +0000 (09:31 +0200)
committerJohannes Berg <[email protected]>
Mon, 7 May 2018 13:01:40 +0000 (15:01 +0200)
commit4bf01ca21e2e0e4561d1a03c48c3d740418702db
treeb243a583f6261adff678a69d677e942704436d45
parente8f90c74e6ab64824f3a21521640de7b21050b9d
rfkill: gpio: fix memory leak in probe error path

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 <[email protected]> # 3.13
Cc: Heikki Krogerus <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Reviewed-by: Heikki Krogerus <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
net/rfkill/rfkill-gpio.c