From: Johan Hovold Date: Mon, 14 Sep 2015 18:19:02 +0000 (+0200) Subject: greybus: vibrator: fix tear-down race X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d7849bffc622b3405ef226364d67bb81af48c152;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git greybus: vibrator: fix tear-down race Do not release the minor number until after the device has been deregistered. Signed-off-by: Johan Hovold Reviewed-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/vibrator.c b/drivers/staging/greybus/vibrator.c index 96d649acf122..fd40cda565e4 100644 --- a/drivers/staging/greybus/vibrator.c +++ b/drivers/staging/greybus/vibrator.c @@ -148,8 +148,8 @@ static void gb_vibrator_connection_exit(struct gb_connection *connection) #if LINUX_VERSION_CODE <= KERNEL_VERSION(3,11,0) sysfs_remove_group(&vib->dev->kobj, vibrator_groups[0]); #endif - ida_simple_remove(&minors, vib->minor); device_unregister(vib->dev); + ida_simple_remove(&minors, vib->minor); kfree(vib); }