Skip to content

Commit 583090b

Browse files
committed
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()
2 parents 3fdd47c + e0894cd commit 583090b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

block/partitions/ibm.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,6 @@ int ibm_partition(struct parsed_partitions *state)
305305
if (!disk->fops->getgeo)
306306
goto out_exit;
307307
fn = symbol_get(dasd_biodasdinfo);
308-
if (!fn)
309-
goto out_exit;
310308
blocksize = bdev_logical_block_size(bdev);
311309
if (blocksize <= 0)
312310
goto out_symbol;
@@ -326,7 +324,7 @@ int ibm_partition(struct parsed_partitions *state)
326324
geo->start = get_start_sect(bdev);
327325
if (disk->fops->getgeo(bdev, geo))
328326
goto out_freeall;
329-
if (fn(disk, info)) {
327+
if (!fn || fn(disk, info)) {
330328
kfree(info);
331329
info = NULL;
332330
}
@@ -370,7 +368,8 @@ int ibm_partition(struct parsed_partitions *state)
370368
out_nogeo:
371369
kfree(info);
372370
out_symbol:
373-
symbol_put(dasd_biodasdinfo);
371+
if (fn)
372+
symbol_put(dasd_biodasdinfo);
374373
out_exit:
375374
return res;
376375
}

block/scsi_ioctl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ struct compat_cdrom_generic_command {
651651
compat_int_t stat;
652652
compat_caddr_t sense;
653653
unsigned char data_direction;
654+
unsigned char pad[3];
654655
compat_int_t quiet;
655656
compat_int_t timeout;
656657
compat_caddr_t reserved[1];

drivers/nvme/host/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3265,8 +3265,10 @@ static int nvme_dev_open(struct inode *inode, struct file *file)
32653265
}
32663266

32673267
nvme_get_ctrl(ctrl);
3268-
if (!try_module_get(ctrl->ops->module))
3268+
if (!try_module_get(ctrl->ops->module)) {
3269+
nvme_put_ctrl(ctrl);
32693270
return -EINVAL;
3271+
}
32703272

32713273
file->private_data = ctrl;
32723274
return 0;

0 commit comments

Comments
 (0)