greybus: raw: fix memory leak on disconnect
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 10 Feb 2016 10:08:29 +0000 (11:08 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 12 Feb 2016 05:46:03 +0000 (21:46 -0800)
commit397d34152423d2ddbff3e48495ef988cbb07776b
tree6854d0fe065965261c4640e75adfab71cde3b7db
parent8d46ec49819599d33ee5cffd43b19bf21f9472b8
greybus: raw: fix memory leak on disconnect

Make sure the class device is freed as well as deregistered on
disconnect.

Also deregister the class device before character device as the former
depends on the latter.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/raw.c