Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195542
b: refs/heads/master
c: 36dd288
h: refs/heads/master
v: v3
  • Loading branch information
Hannes Reinecke authored and James Bottomley committed Apr 11, 2010
1 parent 21e10ad commit 3ce4160
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 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: bb789d01620e5d36081b22edb6fb71cf55ff043c
refs/heads/master: 36dd288f0f930c154ec6a4d73a6a35f3079418c6
10 changes: 8 additions & 2 deletions trunk/drivers/scsi/scsi_transport_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ static ssize_t
store_fc_rport_dev_loss_tmo(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
int val;
unsigned long val;
struct fc_rport *rport = transport_class_to_rport(dev);
struct Scsi_Host *shost = rport_to_shost(rport);
struct fc_internal *i = to_fc_internal(shost->transportt);
Expand All @@ -847,6 +847,12 @@ store_fc_rport_dev_loss_tmo(struct device *dev, struct device_attribute *attr,
if ((*cp && (*cp != '\n')) || (val < 0))
return -EINVAL;

/*
* Check for overflow; dev_loss_tmo is u32
*/
if (val > UINT_MAX)
return -EINVAL;

/*
* If fast_io_fail is off we have to cap
* dev_loss_tmo at SCSI_DEVICE_BLOCK_MAX_TIMEOUT
Expand Down Expand Up @@ -2865,7 +2871,7 @@ void
fc_remote_port_delete(struct fc_rport *rport)
{
struct Scsi_Host *shost = rport_to_shost(rport);
int timeout = rport->dev_loss_tmo;
unsigned long timeout = rport->dev_loss_tmo;
unsigned long flags;

/*
Expand Down

0 comments on commit 3ce4160

Please sign in to comment.