mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-13 00:29:50 +00:00
s390/dasd: check blockdevice pointer before trying to sync blockdevice
If safe offline is called for a DASD alias device a null pointer is passed to fsync_bdev. So check for existence of the blockdevice before calling fsync_bdev. Should not be a real world problem since safe offline for an alias device does not make sense and fsync_bdev can deal with a NULL pointer which it gets after successful NULL pointer dereferencing on s390. Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
2202134e48
commit
ca732e111f
@ -3601,10 +3601,11 @@ int dasd_generic_set_offline(struct ccw_device *cdev)
|
||||
* empty
|
||||
*/
|
||||
/* sync blockdev and partitions */
|
||||
if (device->block) {
|
||||
rc = fsync_bdev(device->block->bdev);
|
||||
if (rc != 0)
|
||||
goto interrupted;
|
||||
|
||||
}
|
||||
/* schedule device tasklet and wait for completion */
|
||||
dasd_schedule_device_bh(device);
|
||||
rc = wait_event_interruptible(shutdown_waitq,
|
||||
|
Loading…
x
Reference in New Issue
Block a user