提交 bb2d3de1 编写于 作者: M Martin K. Petersen 提交者: James Bottomley

[SCSI] sd: Fix VPD buffer allocations

Commit e3deec09 incorrectly assumed that the B0 and B1 page lengths were
limited to 32 bytes.  The B0 VPD page length is defined to be 64 bytes
when the device supports thin provisioning.  B1 is always defined to be
64 bytes.
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Reported-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 74315ad0
......@@ -1948,7 +1948,7 @@ static void sd_read_block_limits(struct scsi_disk *sdkp)
{
struct request_queue *q = sdkp->disk->queue;
unsigned int sector_sz = sdkp->device->sector_size;
const int vpd_len = 32;
const int vpd_len = 64;
unsigned char *buffer = kmalloc(vpd_len, GFP_KERNEL);
if (!buffer ||
......@@ -1998,7 +1998,7 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp)
{
unsigned char *buffer;
u16 rot;
const int vpd_len = 32;
const int vpd_len = 64;
buffer = kmalloc(vpd_len, GFP_KERNEL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册