diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-07-29 21:33:05 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-24 04:11:09 -0400 |
commit | 225c56960fcafeccc2b6304f96cd3f0dbf42a16a (patch) | |
tree | 3e3518154a0c329f776ae981b522b2f215c00372 /drivers/scsi/ibmvscsi | |
parent | 9965c2f19be470c452357ae4f6304467cdeada55 (diff) |
[SCSI] ibmvscsi: Fix host config length field overflow
The length field in the host config packet is only 16-bit long, so
passing it 0x10000 (64K which is our standard PAGE_SIZE) doesn't
work and result in an empty config from the server.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: <stable@vger.kernel.org>
Acked-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index a8462176ee57..ef9a54c7da67 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -1851,6 +1851,9 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata, | |||
1851 | 1851 | ||
1852 | host_config = &evt_struct->iu.mad.host_config; | 1852 | host_config = &evt_struct->iu.mad.host_config; |
1853 | 1853 | ||
1854 | /* The transport length field is only 16-bit */ | ||
1855 | length = min(0xffff, length); | ||
1856 | |||
1854 | /* Set up a lun reset SRP command */ | 1857 | /* Set up a lun reset SRP command */ |
1855 | memset(host_config, 0x00, sizeof(*host_config)); | 1858 | memset(host_config, 0x00, sizeof(*host_config)); |
1856 | host_config->common.type = VIOSRP_HOST_CONFIG_TYPE; | 1859 | host_config->common.type = VIOSRP_HOST_CONFIG_TYPE; |