From: Chad Dupuis Date: Wed, 23 Feb 2011 23:27:07 +0000 (-0800) Subject: [SCSI] qla2xxx: Fix array subscript is above array bounds in qla2xx_build_scsi_type_6... X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7c8cf2fee1027caaadf0e96145ff97f931ba4bdd;p=mv-sheeva.git [SCSI] qla2xxx: Fix array subscript is above array bounds in qla2xx_build_scsi_type_6_iocbs(). The additional increment of dsd_seg was causing the compiler to throw an array out of bounds warning. This patch moves to a direct assignment of cmd_pkt->fcp_data_dseg_len so that the compiler doesn't generate an array out bounds warning. Signed-off-by: Chad Dupuis Signed-off-by: Madhuranath Iyengar Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index fdb96a3584a..b37445d4ea2 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c @@ -2547,7 +2547,7 @@ qla2xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt, dsd_seg = (uint32_t *)&cmd_pkt->fcp_data_dseg_address; *dsd_seg++ = cpu_to_le32(LSD(dsd_ptr->dsd_list_dma)); *dsd_seg++ = cpu_to_le32(MSD(dsd_ptr->dsd_list_dma)); - *dsd_seg++ = dsd_list_len; + cmd_pkt->fcp_data_dseg_len = dsd_list_len; } else { *cur_dsd++ = cpu_to_le32(LSD(dsd_ptr->dsd_list_dma)); *cur_dsd++ = cpu_to_le32(MSD(dsd_ptr->dsd_list_dma));