greybus: vibrator: fix tear-down race

Do not release the minor number until after the device has been
deregistered.

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>
This commit is contained in:
Johan Hovold 2015-09-14 20:19:02 +02:00 committed by Greg Kroah-Hartman
parent 4c9e228407
commit d7849bffc6
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}