Commit 7557c1b3 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "Four small fixes.

  Three are in drivers for fairly obvious bugs. The fourth is a set of
  regressions introduced by the compat_ioctl changes because some of the
  compat updates wrongly replaced .ioctl instead of .compat_ioctl"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: compat_ioctl: cdrom: Replace .ioctl with .compat_ioctl in four appropriate places
  scsi: zfcp: fix wrong data and display format of SFP+ temperature
  scsi: sd_sbc: Fix sd_zbc_report_zones()
  scsi: libfc: free response frame from GPN_ID
parents 29795de0 03264ddd
...@@ -276,7 +276,7 @@ static const struct block_device_operations pcd_bdops = { ...@@ -276,7 +276,7 @@ static const struct block_device_operations pcd_bdops = {
.release = pcd_block_release, .release = pcd_block_release,
.ioctl = pcd_block_ioctl, .ioctl = pcd_block_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.ioctl = blkdev_compat_ptr_ioctl, .compat_ioctl = blkdev_compat_ptr_ioctl,
#endif #endif
.check_events = pcd_block_check_events, .check_events = pcd_block_check_events,
}; };
......
...@@ -519,7 +519,7 @@ static const struct block_device_operations gdrom_bdops = { ...@@ -519,7 +519,7 @@ static const struct block_device_operations gdrom_bdops = {
.check_events = gdrom_bdops_check_events, .check_events = gdrom_bdops_check_events,
.ioctl = gdrom_bdops_ioctl, .ioctl = gdrom_bdops_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.ioctl = blkdev_compat_ptr_ioctl, .compat_ioctl = blkdev_compat_ptr_ioctl,
#endif #endif
}; };
......
...@@ -361,7 +361,7 @@ static const struct block_device_operations ide_gd_ops = { ...@@ -361,7 +361,7 @@ static const struct block_device_operations ide_gd_ops = {
.release = ide_gd_release, .release = ide_gd_release,
.ioctl = ide_gd_ioctl, .ioctl = ide_gd_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.ioctl = ide_gd_compat_ioctl, .compat_ioctl = ide_gd_compat_ioctl,
#endif #endif
.getgeo = ide_gd_getgeo, .getgeo = ide_gd_getgeo,
.check_events = ide_gd_check_events, .check_events = ide_gd_check_events,
......
...@@ -410,7 +410,7 @@ struct fsf_qtcb_bottom_port { ...@@ -410,7 +410,7 @@ struct fsf_qtcb_bottom_port {
u8 cb_util; u8 cb_util;
u8 a_util; u8 a_util;
u8 res2; u8 res2;
u16 temperature; s16 temperature;
u16 vcc; u16 vcc;
u16 tx_bias; u16 tx_bias;
u16 tx_power; u16 tx_power;
......
...@@ -800,7 +800,7 @@ static ZFCP_DEV_ATTR(adapter_diag, b2b_credit, 0400, ...@@ -800,7 +800,7 @@ static ZFCP_DEV_ATTR(adapter_diag, b2b_credit, 0400,
static ZFCP_DEV_ATTR(adapter_diag_sfp, _name, 0400, \ static ZFCP_DEV_ATTR(adapter_diag_sfp, _name, 0400, \
zfcp_sysfs_adapter_diag_sfp_##_name##_show, NULL) zfcp_sysfs_adapter_diag_sfp_##_name##_show, NULL)
ZFCP_DEFINE_DIAG_SFP_ATTR(temperature, temperature, 5, "%hu"); ZFCP_DEFINE_DIAG_SFP_ATTR(temperature, temperature, 6, "%hd");
ZFCP_DEFINE_DIAG_SFP_ATTR(vcc, vcc, 5, "%hu"); ZFCP_DEFINE_DIAG_SFP_ATTR(vcc, vcc, 5, "%hu");
ZFCP_DEFINE_DIAG_SFP_ATTR(tx_bias, tx_bias, 5, "%hu"); ZFCP_DEFINE_DIAG_SFP_ATTR(tx_bias, tx_bias, 5, "%hu");
ZFCP_DEFINE_DIAG_SFP_ATTR(tx_power, tx_power, 5, "%hu"); ZFCP_DEFINE_DIAG_SFP_ATTR(tx_power, tx_power, 5, "%hu");
......
...@@ -628,6 +628,8 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp, ...@@ -628,6 +628,8 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
} }
out: out:
kref_put(&rdata->kref, fc_rport_destroy); kref_put(&rdata->kref, fc_rport_destroy);
if (!IS_ERR(fp))
fc_frame_free(fp);
} }
/** /**
......
...@@ -161,6 +161,7 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector, ...@@ -161,6 +161,7 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector,
unsigned int nr_zones, report_zones_cb cb, void *data) unsigned int nr_zones, report_zones_cb cb, void *data)
{ {
struct scsi_disk *sdkp = scsi_disk(disk); struct scsi_disk *sdkp = scsi_disk(disk);
sector_t capacity = logical_to_sectors(sdkp->device, sdkp->capacity);
unsigned int nr, i; unsigned int nr, i;
unsigned char *buf; unsigned char *buf;
size_t offset, buflen = 0; size_t offset, buflen = 0;
...@@ -171,11 +172,15 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector, ...@@ -171,11 +172,15 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector,
/* Not a zoned device */ /* Not a zoned device */
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (!capacity)
/* Device gone or invalid */
return -ENODEV;
buf = sd_zbc_alloc_report_buffer(sdkp, nr_zones, &buflen); buf = sd_zbc_alloc_report_buffer(sdkp, nr_zones, &buflen);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
while (zone_idx < nr_zones && sector < get_capacity(disk)) { while (zone_idx < nr_zones && sector < capacity) {
ret = sd_zbc_do_report_zones(sdkp, buf, buflen, ret = sd_zbc_do_report_zones(sdkp, buf, buflen,
sectors_to_logical(sdkp->device, sector), true); sectors_to_logical(sdkp->device, sector), true);
if (ret) if (ret)
......
...@@ -688,7 +688,7 @@ static const struct block_device_operations sr_bdops = ...@@ -688,7 +688,7 @@ static const struct block_device_operations sr_bdops =
.release = sr_block_release, .release = sr_block_release,
.ioctl = sr_block_ioctl, .ioctl = sr_block_ioctl,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.ioctl = sr_block_compat_ioctl, .compat_ioctl = sr_block_compat_ioctl,
#endif #endif
.check_events = sr_block_check_events, .check_events = sr_block_check_events,
.revalidate_disk = sr_block_revalidate_disk, .revalidate_disk = sr_block_revalidate_disk,
......
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