Skip to content

Commit

Permalink
[SCSI] sd: Fix VPD buffer allocations
Browse files Browse the repository at this point in the history
Commit e3deec0 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: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Mar 3, 2010
1 parent 74315ad commit bb2d3de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit bb2d3de

Please sign in to comment.