@@ -910,7 +910,8 @@ qla27xx_template_checksum(void *p, ulong size)
910910static inline int
911911qla27xx_verify_template_checksum (struct qla27xx_fwdt_template * tmp )
912912{
913- return qla27xx_template_checksum (tmp , tmp -> template_size ) == 0 ;
913+ return qla27xx_template_checksum (tmp ,
914+ le32_to_cpu (tmp -> template_size )) == 0 ;
914915}
915916
916917static inline int
@@ -926,7 +927,7 @@ qla27xx_execute_fwdt_template(struct scsi_qla_host *vha,
926927 ulong len = 0 ;
927928
928929 if (qla27xx_fwdt_template_valid (tmp )) {
929- len = tmp -> template_size ;
930+ len = le32_to_cpu ( tmp -> template_size ) ;
930931 tmp = memcpy (buf , tmp , len );
931932 ql27xx_edit_template (vha , tmp );
932933 qla27xx_walk_template (vha , tmp , buf , & len );
@@ -942,7 +943,7 @@ qla27xx_fwdt_calculate_dump_size(struct scsi_qla_host *vha, void *p)
942943 ulong len = 0 ;
943944
944945 if (qla27xx_fwdt_template_valid (tmp )) {
945- len = tmp -> template_size ;
946+ len = le32_to_cpu ( tmp -> template_size ) ;
946947 qla27xx_walk_template (vha , tmp , NULL , & len );
947948 }
948949
@@ -954,7 +955,7 @@ qla27xx_fwdt_template_size(void *p)
954955{
955956 struct qla27xx_fwdt_template * tmp = p ;
956957
957- return tmp -> template_size ;
958+ return le32_to_cpu ( tmp -> template_size ) ;
958959}
959960
960961int
0 commit comments