]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
memstick/mspro_block: fix handling of read-only devices
authorChristoph Hellwig <hch@lst.de>
Tue, 15 Feb 2022 09:45:12 +0000 (10:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:06:32 +0000 (14:06 +0200)
commit057b53c4f87690d626203acef8b63d52a9bf2f43
treec81ef57105a410f96034aaa3976eba619babbe58
parent7d6cebd25a0b0e4e9161537f15cf094c2ced82c5
memstick/mspro_block: fix handling of read-only devices

[ Upstream commit 6dab421bfe06a59bf8f212a72e34673e8acf2018 ]

Use set_disk_ro to propagate the read-only state to the block layer
instead of checking for it in ->open and leaking a reference in case
of a read-only device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220215094514.3828912-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/memstick/core/mspro_block.c