ar71xx/ar93xx_wmac_otp_read_word: fix wrongly used sizeof(*u)
authorAlexander Couzens <lynxis@fe80.eu>
Sun, 11 Jun 2017 11:43:55 +0000 (13:43 +0200)
committerAlexander Couzens <lynxis@fe80.eu>
Sun, 11 Jun 2017 12:22:44 +0000 (14:22 +0200)
Found-by: Coverity Scan #1330474
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
target/linux/ar71xx/patches-4.4/523-MIPS-ath79-OTP-support.patch

index 6778183f78d628f526f56c6a07ca9f5f4f53ee36..fa5681b7463b51a6aed51276ac0d82022249d9e7 100644 (file)
 +
 +      BUG_ON(!soc_is_ar933x() && !soc_is_ar934x());
 +      base = ioremap_nocache(AR93XX_WMAC_BASE, AR93XX_WMAC_SIZE);
-+      while (addr > sizeof(hdr)) {
-+              if (!ar93xx_wmac_otp_read(base, addr, hdr, sizeof(hdr)))
++      while (addr > sizeof(hdr_u32)) {
++              if (!ar93xx_wmac_otp_read(base, addr, hdr, sizeof(hdr_u32)))
 +                      break;
 +
 +              if (hdr_u32 == 0 || hdr_u32 == ~0)