Commit 583090b1 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'block5.9-2020-10-08' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "A few fixes that should go into this release:

   - NVMe controller error path reference fix (Chaitanya)

   - Fix regression with IBM partitions on non-dasd devices (Christoph)

   - Fix a missing clear in the compat CDROM packet structure (Peilin)"

* tag 'block5.9-2020-10-08' of git://git.kernel.dk/linux-block:
  partitions/ibm: fix non-DASD devices
  nvme-core: put ctrl ref when module ref get fail
  block/scsi-ioctl: Fix kernel-infoleak in scsi_put_cdrom_generic_arg()
parents 3fdd47c3 e0894cd6
...@@ -305,8 +305,6 @@ int ibm_partition(struct parsed_partitions *state) ...@@ -305,8 +305,6 @@ int ibm_partition(struct parsed_partitions *state)
if (!disk->fops->getgeo) if (!disk->fops->getgeo)
goto out_exit; goto out_exit;
fn = symbol_get(dasd_biodasdinfo); fn = symbol_get(dasd_biodasdinfo);
if (!fn)
goto out_exit;
blocksize = bdev_logical_block_size(bdev); blocksize = bdev_logical_block_size(bdev);
if (blocksize <= 0) if (blocksize <= 0)
goto out_symbol; goto out_symbol;
...@@ -326,7 +324,7 @@ int ibm_partition(struct parsed_partitions *state) ...@@ -326,7 +324,7 @@ int ibm_partition(struct parsed_partitions *state)
geo->start = get_start_sect(bdev); geo->start = get_start_sect(bdev);
if (disk->fops->getgeo(bdev, geo)) if (disk->fops->getgeo(bdev, geo))
goto out_freeall; goto out_freeall;
if (fn(disk, info)) { if (!fn || fn(disk, info)) {
kfree(info); kfree(info);
info = NULL; info = NULL;
} }
...@@ -370,7 +368,8 @@ int ibm_partition(struct parsed_partitions *state) ...@@ -370,7 +368,8 @@ int ibm_partition(struct parsed_partitions *state)
out_nogeo: out_nogeo:
kfree(info); kfree(info);
out_symbol: out_symbol:
symbol_put(dasd_biodasdinfo); if (fn)
symbol_put(dasd_biodasdinfo);
out_exit: out_exit:
return res; return res;
} }
...@@ -651,6 +651,7 @@ struct compat_cdrom_generic_command { ...@@ -651,6 +651,7 @@ struct compat_cdrom_generic_command {
compat_int_t stat; compat_int_t stat;
compat_caddr_t sense; compat_caddr_t sense;
unsigned char data_direction; unsigned char data_direction;
unsigned char pad[3];
compat_int_t quiet; compat_int_t quiet;
compat_int_t timeout; compat_int_t timeout;
compat_caddr_t reserved[1]; compat_caddr_t reserved[1];
......
...@@ -3265,8 +3265,10 @@ static int nvme_dev_open(struct inode *inode, struct file *file) ...@@ -3265,8 +3265,10 @@ static int nvme_dev_open(struct inode *inode, struct file *file)
} }
nvme_get_ctrl(ctrl); nvme_get_ctrl(ctrl);
if (!try_module_get(ctrl->ops->module)) if (!try_module_get(ctrl->ops->module)) {
nvme_put_ctrl(ctrl);
return -EINVAL; return -EINVAL;
}
file->private_data = ctrl; file->private_data = ctrl;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment