diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-13 19:59:15 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-13 19:59:15 -0400 |
commit | 7d72e6fa56c4100b9669efe0044f77ed9eb785a1 (patch) | |
tree | 5e90bf4969809a1ab20b97432b85be20ccfaa1f4 /drivers/message/i2o | |
parent | ba00376b0b13f234d839541a7b36a5bf5c2a4036 (diff) | |
parent | 2be1f3a73dd02e38e181cf5abacb3d45a6a2d6b8 (diff) |
Merge branch 'master' into for-linus
Diffstat (limited to 'drivers/message/i2o')
-rw-r--r-- | drivers/message/i2o/exec-osm.c | 8 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_block.c | 3 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_config.c | 18 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_scsi.c | 3 |
4 files changed, 19 insertions, 13 deletions
diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index 06c655c55587..a3970e56ae53 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c | |||
@@ -389,12 +389,16 @@ static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind) | |||
389 | dev = &c->pdev->dev; | 389 | dev = &c->pdev->dev; |
390 | 390 | ||
391 | if (i2o_dma_realloc(dev, &c->dlct, | 391 | if (i2o_dma_realloc(dev, &c->dlct, |
392 | le32_to_cpu(sb->expected_lct_size))) | 392 | le32_to_cpu(sb->expected_lct_size))) { |
393 | mutex_unlock(&c->lct_lock); | ||
393 | return -ENOMEM; | 394 | return -ENOMEM; |
395 | } | ||
394 | 396 | ||
395 | msg = i2o_msg_get_wait(c, I2O_TIMEOUT_MESSAGE_GET); | 397 | msg = i2o_msg_get_wait(c, I2O_TIMEOUT_MESSAGE_GET); |
396 | if (IS_ERR(msg)) | 398 | if (IS_ERR(msg)) { |
399 | mutex_unlock(&c->lct_lock); | ||
397 | return PTR_ERR(msg); | 400 | return PTR_ERR(msg); |
401 | } | ||
398 | 402 | ||
399 | msg->u.head[0] = cpu_to_le32(EIGHT_WORD_MSG_SIZE | SGL_OFFSET_6); | 403 | msg->u.head[0] = cpu_to_le32(EIGHT_WORD_MSG_SIZE | SGL_OFFSET_6); |
400 | msg->u.head[1] = cpu_to_le32(I2O_CMD_LCT_NOTIFY << 24 | HOST_TID << 12 | | 404 | msg->u.head[1] = cpu_to_le32(I2O_CMD_LCT_NOTIFY << 24 | HOST_TID << 12 | |
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index e6733bc99724..f0f1e667000f 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c | |||
@@ -727,7 +727,7 @@ static int i2o_block_transfer(struct request *req) | |||
727 | { | 727 | { |
728 | struct i2o_block_device *dev = req->rq_disk->private_data; | 728 | struct i2o_block_device *dev = req->rq_disk->private_data; |
729 | struct i2o_controller *c; | 729 | struct i2o_controller *c; |
730 | u32 tid = dev->i2o_dev->lct_data.tid; | 730 | u32 tid; |
731 | struct i2o_message *msg; | 731 | struct i2o_message *msg; |
732 | u32 *mptr; | 732 | u32 *mptr; |
733 | struct i2o_block_request *ireq = req->special; | 733 | struct i2o_block_request *ireq = req->special; |
@@ -743,6 +743,7 @@ static int i2o_block_transfer(struct request *req) | |||
743 | goto exit; | 743 | goto exit; |
744 | } | 744 | } |
745 | 745 | ||
746 | tid = dev->i2o_dev->lct_data.tid; | ||
746 | c = dev->i2o_dev->iop; | 747 | c = dev->i2o_dev->iop; |
747 | 748 | ||
748 | msg = i2o_msg_get(c); | 749 | msg = i2o_msg_get(c); |
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index c4b117f5fb70..068ba0785bb4 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c | |||
@@ -111,11 +111,11 @@ static int i2o_cfg_gethrt(unsigned long arg) | |||
111 | 111 | ||
112 | len = 8 + ((hrt->entry_len * hrt->num_entries) << 2); | 112 | len = 8 + ((hrt->entry_len * hrt->num_entries) << 2); |
113 | 113 | ||
114 | /* We did a get user...so assuming mem is ok...is this bad? */ | 114 | if (put_user(len, kcmd.reslen)) |
115 | put_user(len, kcmd.reslen); | 115 | ret = -EFAULT; |
116 | if (len > reslen) | 116 | else if (len > reslen) |
117 | ret = -ENOBUFS; | 117 | ret = -ENOBUFS; |
118 | if (copy_to_user(kcmd.resbuf, (void *)hrt, len)) | 118 | else if (copy_to_user(kcmd.resbuf, (void *)hrt, len)) |
119 | ret = -EFAULT; | 119 | ret = -EFAULT; |
120 | 120 | ||
121 | return ret; | 121 | return ret; |
@@ -147,8 +147,9 @@ static int i2o_cfg_getlct(unsigned long arg) | |||
147 | lct = (i2o_lct *) c->lct; | 147 | lct = (i2o_lct *) c->lct; |
148 | 148 | ||
149 | len = (unsigned int)lct->table_size << 2; | 149 | len = (unsigned int)lct->table_size << 2; |
150 | put_user(len, kcmd.reslen); | 150 | if (put_user(len, kcmd.reslen)) |
151 | if (len > reslen) | 151 | ret = -EFAULT; |
152 | else if (len > reslen) | ||
152 | ret = -ENOBUFS; | 153 | ret = -ENOBUFS; |
153 | else if (copy_to_user(kcmd.resbuf, lct, len)) | 154 | else if (copy_to_user(kcmd.resbuf, lct, len)) |
154 | ret = -EFAULT; | 155 | ret = -EFAULT; |
@@ -208,8 +209,9 @@ static int i2o_cfg_parms(unsigned long arg, unsigned int type) | |||
208 | return -EAGAIN; | 209 | return -EAGAIN; |
209 | } | 210 | } |
210 | 211 | ||
211 | put_user(len, kcmd.reslen); | 212 | if (put_user(len, kcmd.reslen)) |
212 | if (len > reslen) | 213 | ret = -EFAULT; |
214 | else if (len > reslen) | ||
213 | ret = -ENOBUFS; | 215 | ret = -ENOBUFS; |
214 | else if (copy_to_user(kcmd.resbuf, res, len)) | 216 | else if (copy_to_user(kcmd.resbuf, res, len)) |
215 | ret = -EFAULT; | 217 | ret = -EFAULT; |
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c index 3d45817e6dcd..ea6b2197da8a 100644 --- a/drivers/message/i2o/i2o_scsi.c +++ b/drivers/message/i2o/i2o_scsi.c | |||
@@ -528,7 +528,6 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
528 | * Do the incoming paperwork | 528 | * Do the incoming paperwork |
529 | */ | 529 | */ |
530 | i2o_dev = SCpnt->device->hostdata; | 530 | i2o_dev = SCpnt->device->hostdata; |
531 | c = i2o_dev->iop; | ||
532 | 531 | ||
533 | SCpnt->scsi_done = done; | 532 | SCpnt->scsi_done = done; |
534 | 533 | ||
@@ -538,7 +537,7 @@ static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt, | |||
538 | done(SCpnt); | 537 | done(SCpnt); |
539 | goto exit; | 538 | goto exit; |
540 | } | 539 | } |
541 | 540 | c = i2o_dev->iop; | |
542 | tid = i2o_dev->lct_data.tid; | 541 | tid = i2o_dev->lct_data.tid; |
543 | 542 | ||
544 | osm_debug("qcmd: Tid = %03x\n", tid); | 543 | osm_debug("qcmd: Tid = %03x\n", tid); |