diff options
author | Christoph Hellwig <[email protected]> | 2021-12-21 17:18:51 +0100 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2021-12-21 09:31:51 -0700 |
commit | 99d8690aae4b2f0d1d90075de355ac087f820a66 (patch) | |
tree | 602e947ef3c103a6be94489d84cb1e8da3523aa9 /include/linux/overflow.h | |
parent | 37e11c3616f6182b6bd7f95a04df035b43464f39 (diff) |
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: 83cbce9574462c6b ("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]>
Diffstat (limited to 'include/linux/overflow.h')
0 files changed, 0 insertions, 0 deletions