OSDN Git Service

cdrom: respect device capabilities during opening action
authorDiego Elio Pettenò <flameeyes@flameeyes.com>
Tue, 19 Nov 2019 21:37:08 +0000 (21:37 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 12:34:36 +0000 (13:34 +0100)
commite53915bcd2bde5e86f896e47287be485ca4acebb
tree306f65dbc4fce4d21316bdeb48ec6af7756df6a4
parent5f9d7ba584a152f56e90821272f51ea32cfa3c65
cdrom: respect device capabilities during opening action

[ Upstream commit 366ba7c71ef77c08d06b18ad61b26e2df7352338 ]

Reading the TOC only works if the device can play audio, otherwise
these commands fail (and possibly bring the device to an unhealthy
state.)

Similarly, cdrom_mmc3_profile() should only be called if the device
supports generic packet commands.

To: Jens Axboe <axboe@kernel.dk>
Cc: linux-kernel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cdrom/cdrom.c