OSDN Git Service

cdrom: don't attempt to fiddle with cdo->capability
authorJens Axboe <axboe@kernel.dk>
Sun, 14 Oct 2018 19:20:48 +0000 (13:20 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Dec 2019 08:16:20 +0000 (09:16 +0100)
commit2cd0b70c55b0e71f578134510107d002d52ee235
treeaaafcbeea0e98ad5751502d2cfb9a7af03732dd5
parent0c5c34c1aaf3651fc4271a642b70a39b3729a5bd
cdrom: don't attempt to fiddle with cdo->capability

[ Upstream commit 8f94004e2a51a3ea195cf3447eb5d5906f36d8b3 ]

We can't modify cdo->capability as it is defined as a const.
Change the modification hack to just WARN_ON_ONCE() if we hit
any of the invalid combinations.

This fixes a regression for pcd, which doesn't work after the
constify patch.

Fixes: 853fe1bf7554 ("cdrom: Make device operations read-only")
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cdrom/cdrom.c