Commit d953e0e8 authored by Committed by Greg Kroah-Hartman
pps: Fix a use-after free bug when unregistering a source.
Remove the cdev from the system (with cdev_del) *before* deallocating it (in pps_device_destruct, called via kobject_put from device_destroy). Also prevent deallocating a device with open file handles. A better long-term fix is probably to remove the cdev from the pps_device entirely, and instead have all devices reference one global cdev. Then the deallocation ordering becomes simpler. But that's more complex and invasive change, so we leave that for later. Signed-off-by: George Spelvin <firstname.lastname@example.org> Cc: stable <email@example.com> Acked-by: Rodolfo Giometti <firstname.lastname@example.org> Signed-off-by: Greg Kroah-Hartman <email@example.com>
Showing with 10 additions and 4 deletions