Skip to content

Commit

Permalink
staging: android: timed_output: fix use after free of dev
Browse files Browse the repository at this point in the history
tdev->dev has been freed in device_destroy(), it's not right to
use dev_set_drvdata() after that;

Signed-off-by: Yi Zhang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Yi Zhang authored and gregkh committed Jun 20, 2014
1 parent 8851362 commit b28e7d5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/staging/android/timed_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b28e7d5

Please sign in to comment.