diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-10-09 14:51:59 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-10-09 14:51:59 -0700 |
| commit | 50eb0a06e6cae01d8a8d63770030d01ac2fb572a (patch) | |
| tree | 31d45b247b399ff4cb44207cbcfee77950aff94e /block/bdev.c | |
| parent | Merge tag '5.15-rc4-ksmbd-fixes' of git://git.samba.org/ksmbd (diff) | |
| parent | block: decode QUEUE_FLAG_HCTX_ACTIVE in debugfs output (diff) | |
| download | linux-50eb0a06e6cae01d8a8d63770030d01ac2fb572a.tar.gz linux-50eb0a06e6cae01d8a8d63770030d01ac2fb572a.zip | |
Merge tag 'block-5.15-2021-10-09' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe:
"Two small fixes for this release:
- Add missing QUEUE_FLAG_HCTX_ACTIVE in the debugfs handling
(Johannes)
- Fix double free / UAF issue in __alloc_disk_node (Tetsuo)"
* tag 'block-5.15-2021-10-09' of git://git.kernel.dk/linux-block:
block: decode QUEUE_FLAG_HCTX_ACTIVE in debugfs output
block: genhd: fix double kfree() in __alloc_disk_node()
Diffstat (limited to 'block/bdev.c')
| -rw-r--r-- | block/bdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/bdev.c b/block/bdev.c index cf2780cb44a7..485a258b0ab3 100644 --- a/block/bdev.c +++ b/block/bdev.c @@ -490,7 +490,6 @@ struct block_device *bdev_alloc(struct gendisk *disk, u8 partno) bdev = I_BDEV(inode); mutex_init(&bdev->bd_fsfreeze_mutex); spin_lock_init(&bdev->bd_size_lock); - bdev->bd_disk = disk; bdev->bd_partno = partno; bdev->bd_inode = inode; bdev->bd_stats = alloc_percpu(struct disk_stats); @@ -498,6 +497,7 @@ struct block_device *bdev_alloc(struct gendisk *disk, u8 partno) iput(inode); return NULL; } + bdev->bd_disk = disk; return bdev; } |
