Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
block: fix error unwinding in device_add_disk
One device_add is called disk->ev will be freed by disk_release, so we should free it twice. Fix this by allocating disk->ev after device_add so that the extra local unwinding can be removed entirely. Based on an earlier patch from Tetsuo Handa. Reported-by: syzbot <[email protected]> Tested-by: syzbot <[email protected]> Fixes: 83cbce9 ("block: add error handling for device_add_disk / add_disk") Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
- Loading branch information