Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107579
b: refs/heads/master
c: 671a99c
h: refs/heads/master
i:
  107577: c601e52
  107575: 1486029
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Jul 30, 2008
1 parent 5a985fc commit 896849f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ad337591f4fd20de6a0ca03d6715267a5c1d2b16
refs/heads/master: 671a99c8eb2f1dde08ac5538d8cd912047c61ddf
18 changes: 14 additions & 4 deletions trunk/drivers/scsi/ses.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,14 @@ static int ses_enclosure_find_by_addr(struct enclosure_device *edev,
return 0;
}

#define VPD_INQUIRY_SIZE 512
#define VPD_INQUIRY_SIZE 36

static void ses_match_to_enclosure(struct enclosure_device *edev,
struct scsi_device *sdev)
{
unsigned char *buf = kmalloc(VPD_INQUIRY_SIZE, GFP_KERNEL);
unsigned char *desc;
int len;
u16 vpd_len;
struct efd efd = {
.addr = 0,
};
Expand All @@ -372,9 +372,19 @@ static void ses_match_to_enclosure(struct enclosure_device *edev,
VPD_INQUIRY_SIZE, NULL, SES_TIMEOUT, SES_RETRIES))
goto free;

len = (buf[2] << 8) + buf[3];
vpd_len = (buf[2] << 8) + buf[3];
kfree(buf);
buf = kmalloc(vpd_len, GFP_KERNEL);
if (!buf)
return;
cmd[3] = vpd_len >> 8;
cmd[4] = vpd_len & 0xff;
if (scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf,
vpd_len, NULL, SES_TIMEOUT, SES_RETRIES))
goto free;

desc = buf + 4;
while (desc < buf + len) {
while (desc < buf + vpd_len) {
enum scsi_protocol proto = desc[0] >> 4;
u8 code_set = desc[0] & 0x0f;
u8 piv = desc[1] & 0x80;
Expand Down

0 comments on commit 896849f

Please sign in to comment.