diff options
Diffstat (limited to 'drivers/scsi/libsrp.c')
-rw-r--r-- | drivers/scsi/libsrp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/libsrp.c b/drivers/scsi/libsrp.c index 6335830df810..5631c199a8eb 100644 --- a/drivers/scsi/libsrp.c +++ b/drivers/scsi/libsrp.c | |||
@@ -224,8 +224,7 @@ static int srp_indirect_data(struct scsi_cmnd *sc, struct srp_cmd *cmd, | |||
224 | struct srp_direct_buf *md = NULL; | 224 | struct srp_direct_buf *md = NULL; |
225 | struct scatterlist dummy, *sg = NULL; | 225 | struct scatterlist dummy, *sg = NULL; |
226 | dma_addr_t token = 0; | 226 | dma_addr_t token = 0; |
227 | long err; | 227 | int err = 0; |
228 | unsigned int done = 0; | ||
229 | int nmd, nsg = 0, len; | 228 | int nmd, nsg = 0, len; |
230 | 229 | ||
231 | if (dma_map || ext_desc) { | 230 | if (dma_map || ext_desc) { |
@@ -257,8 +256,8 @@ static int srp_indirect_data(struct scsi_cmnd *sc, struct srp_cmd *cmd, | |||
257 | sg_dma_address(&dummy) = token; | 256 | sg_dma_address(&dummy) = token; |
258 | err = rdma_io(sc, &dummy, 1, &id->table_desc, 1, DMA_TO_DEVICE, | 257 | err = rdma_io(sc, &dummy, 1, &id->table_desc, 1, DMA_TO_DEVICE, |
259 | id->table_desc.len); | 258 | id->table_desc.len); |
260 | if (err < 0) { | 259 | if (err) { |
261 | eprintk("Error copying indirect table %ld\n", err); | 260 | eprintk("Error copying indirect table %d\n", err); |
262 | goto free_mem; | 261 | goto free_mem; |
263 | } | 262 | } |
264 | } else { | 263 | } else { |
@@ -271,6 +270,7 @@ rdma: | |||
271 | nsg = dma_map_sg(iue->target->dev, sg, sc->use_sg, DMA_BIDIRECTIONAL); | 270 | nsg = dma_map_sg(iue->target->dev, sg, sc->use_sg, DMA_BIDIRECTIONAL); |
272 | if (!nsg) { | 271 | if (!nsg) { |
273 | eprintk("fail to map %p %d\n", iue, sc->use_sg); | 272 | eprintk("fail to map %p %d\n", iue, sc->use_sg); |
273 | err = -EIO; | ||
274 | goto free_mem; | 274 | goto free_mem; |
275 | } | 275 | } |
276 | len = min(sc->request_bufflen, id->len); | 276 | len = min(sc->request_bufflen, id->len); |
@@ -286,7 +286,7 @@ free_mem: | |||
286 | if (token && dma_map) | 286 | if (token && dma_map) |
287 | dma_free_coherent(iue->target->dev, id->table_desc.len, md, token); | 287 | dma_free_coherent(iue->target->dev, id->table_desc.len, md, token); |
288 | 288 | ||
289 | return done; | 289 | return err; |
290 | } | 290 | } |
291 | 291 | ||
292 | static int data_out_desc_size(struct srp_cmd *cmd) | 292 | static int data_out_desc_size(struct srp_cmd *cmd) |
@@ -351,7 +351,7 @@ int srp_transfer_data(struct scsi_cmnd *sc, struct srp_cmd *cmd, | |||
351 | break; | 351 | break; |
352 | default: | 352 | default: |
353 | eprintk("Unknown format %d %x\n", dir, format); | 353 | eprintk("Unknown format %d %x\n", dir, format); |
354 | break; | 354 | err = -EINVAL; |
355 | } | 355 | } |
356 | 356 | ||
357 | return err; | 357 | return err; |