diff options
-rw-r--r-- | drivers/scsi/aacraid/aachba.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 1e82c69b36b0..6c4319c98fee 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c | |||
@@ -340,7 +340,7 @@ int aac_get_containers(struct aac_dev *dev) | |||
340 | static void aac_internal_transfer(struct scsi_cmnd *scsicmd, void *data, unsigned int offset, unsigned int len) | 340 | static void aac_internal_transfer(struct scsi_cmnd *scsicmd, void *data, unsigned int offset, unsigned int len) |
341 | { | 341 | { |
342 | void *buf; | 342 | void *buf; |
343 | unsigned int transfer_len; | 343 | int transfer_len; |
344 | struct scatterlist *sg = scsicmd->request_buffer; | 344 | struct scatterlist *sg = scsicmd->request_buffer; |
345 | 345 | ||
346 | if (scsicmd->use_sg) { | 346 | if (scsicmd->use_sg) { |
@@ -351,7 +351,7 @@ static void aac_internal_transfer(struct scsi_cmnd *scsicmd, void *data, unsigne | |||
351 | transfer_len = min(scsicmd->request_bufflen, len + offset); | 351 | transfer_len = min(scsicmd->request_bufflen, len + offset); |
352 | } | 352 | } |
353 | transfer_len -= offset; | 353 | transfer_len -= offset; |
354 | if (buf && transfer_len) | 354 | if (buf && transfer_len > 0) |
355 | memcpy(buf + offset, data, transfer_len); | 355 | memcpy(buf + offset, data, transfer_len); |
356 | 356 | ||
357 | if (scsicmd->use_sg) | 357 | if (scsicmd->use_sg) |