[SCSI] lpfc 8.3.40: Fix starting reference tag when calculating BG error
authorJames Smart <james.smart@emulex.com>
Fri, 31 May 2013 21:04:10 +0000 (17:04 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 26 Jun 2013 17:48:44 +0000 (10:48 -0700)
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/lpfc/lpfc_scsi.c

index 2e31106c699ee76055ab2a33cfd3f26117bb3492..853223947d7adab6768e5ce73ed768e231485f8e 100644 (file)
@@ -3088,9 +3088,9 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
                        chk_guard = 1;
                guard_type = scsi_host_get_guard(cmd->device->host);
 
+               src = (struct scsi_dif_tuple *)sg_virt(sgpe);
                start_ref_tag = (uint32_t)scsi_get_lba(cmd); /* Truncate LBA */
                start_app_tag = src->app_tag;
-               src = (struct scsi_dif_tuple *)sg_virt(sgpe);
                len = sgpe->length;
                while (src && protsegcnt) {
                        while (len) {