]> git.baikalelectronics.ru Git - kernel.git/commitdiff
staging: android: timed_output: fix use after free of dev
authorYi Zhang <yizhang@marvell.com>
Tue, 3 Jun 2014 13:03:08 +0000 (21:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jun 2014 00:33:37 +0000 (17:33 -0700)
tdev->dev has been freed in device_destroy(), it's not right to
use dev_set_drvdata() after that;

Signed-off-by: Yi Zhang <yizhang@marvell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/timed_output.c

index 2c617834dc46c8f81033638ba0043ab9eac7740e..c341ac11c5a3dc8260961a8dc144a6666049e234 100644 (file)
@@ -97,7 +97,6 @@ void timed_output_dev_unregister(struct timed_output_dev *tdev)
 {
        tdev->enable(tdev, 0);
        device_destroy(timed_output_class, MKDEV(0, tdev->index));
-       dev_set_drvdata(tdev->dev, NULL);
 }
 EXPORT_SYMBOL_GPL(timed_output_dev_unregister);