@@ -928,7 +928,8 @@ qla27xx_template_checksum(void *p, ulong size)
928928static inline int
929929qla27xx_verify_template_checksum (struct qla27xx_fwdt_template * tmp )
930930{
931- return qla27xx_template_checksum (tmp , tmp -> template_size ) == 0 ;
931+ return qla27xx_template_checksum (tmp ,
932+ le32_to_cpu (tmp -> template_size )) == 0 ;
932933}
933934
934935static inline int
@@ -944,7 +945,7 @@ qla27xx_execute_fwdt_template(struct scsi_qla_host *vha,
944945 ulong len = 0 ;
945946
946947 if (qla27xx_fwdt_template_valid (tmp )) {
947- len = tmp -> template_size ;
948+ len = le32_to_cpu ( tmp -> template_size ) ;
948949 tmp = memcpy (buf , tmp , len );
949950 ql27xx_edit_template (vha , tmp );
950951 qla27xx_walk_template (vha , tmp , buf , & len );
@@ -960,7 +961,7 @@ qla27xx_fwdt_calculate_dump_size(struct scsi_qla_host *vha, void *p)
960961 ulong len = 0 ;
961962
962963 if (qla27xx_fwdt_template_valid (tmp )) {
963- len = tmp -> template_size ;
964+ len = le32_to_cpu ( tmp -> template_size ) ;
964965 qla27xx_walk_template (vha , tmp , NULL , & len );
965966 }
966967
@@ -972,7 +973,7 @@ qla27xx_fwdt_template_size(void *p)
972973{
973974 struct qla27xx_fwdt_template * tmp = p ;
974975
975- return tmp -> template_size ;
976+ return le32_to_cpu ( tmp -> template_size ) ;
976977}
977978
978979int
0 commit comments