Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360265
b: refs/heads/master
c: c1f63c8
h: refs/heads/master
i:
  360263: 56cdb52
v: v3
  • Loading branch information
Stephen M. Cameron authored and James Bottomley committed Feb 24, 2013
1 parent c78e4f8 commit cca467c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 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: e2bea6df3261dac1ae400452ddab07babb4fc5f3
refs/heads/master: c1f63c8fe85a63ccf308909237216f55711e5434
25 changes: 13 additions & 12 deletions trunk/drivers/scsi/hpsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -2959,6 +2959,7 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp)
struct CommandList *c;
char *buff = NULL;
union u64bit temp64;
int rc = 0;

if (!argp)
return -EINVAL;
Expand All @@ -2978,17 +2979,17 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp)
/* Copy the data into the buffer we created */
if (copy_from_user(buff, iocommand.buf,
iocommand.buf_size)) {
kfree(buff);
return -EFAULT;
rc = -EFAULT;
goto out_kfree;
}
} else {
memset(buff, 0, iocommand.buf_size);
}
}
c = cmd_special_alloc(h);
if (c == NULL) {
kfree(buff);
return -ENOMEM;
rc = -ENOMEM;
goto out_kfree;
}
/* Fill in the command type */
c->cmd_type = CMD_IOCTL_PEND;
Expand Down Expand Up @@ -3027,22 +3028,22 @@ static int hpsa_passthru_ioctl(struct ctlr_info *h, void __user *argp)
memcpy(&iocommand.error_info, c->err_info,
sizeof(iocommand.error_info));
if (copy_to_user(argp, &iocommand, sizeof(iocommand))) {
kfree(buff);
cmd_special_free(h, c);
return -EFAULT;
rc = -EFAULT;
goto out;
}
if (iocommand.Request.Type.Direction == XFER_READ &&
iocommand.buf_size > 0) {
/* Copy the data out of the buffer we created */
if (copy_to_user(iocommand.buf, buff, iocommand.buf_size)) {
kfree(buff);
cmd_special_free(h, c);
return -EFAULT;
rc = -EFAULT;
goto out;
}
}
kfree(buff);
out:
cmd_special_free(h, c);
return 0;
out_kfree:
kfree(buff);
return rc;
}

static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
Expand Down

0 comments on commit cca467c

Please sign in to comment.