android_kernel_xiaomi_sm8350/drivers/cdrom
Greg Kroah-Hartman 6f2e5eb825 cdrom: gdrom: initialize global variable at init time
commit 9183f01b5e6e32eb3f17b5f3f8d5ad5ac9786c49 upstream.

As Peter points out, if we were to disconnect and then reconnect this
driver from a device, the "global" state of the device would contain odd
values and could cause problems.  Fix this up by just initializing the
whole thing to 0 at probe() time.

Ideally this would be a per-device variable, but given the age and the
total lack of users of it, that would require a lot of s/./->/g changes
for really no good reason.

Reported-by: Peter Rosin <peda@axentia.se>
Cc: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/YJP2j6AU82MqEY2M@kroah.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-26 12:05:19 +02:00
..
cdrom.c cdrom: respect device capabilities during opening action 2020-01-04 19:18:25 +01:00
gdrom.c cdrom: gdrom: initialize global variable at init time 2021-05-26 12:05:19 +02:00
Makefile Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block 2017-11-14 15:32:19 -08:00