]> git.sur5r.net Git - u-boot/commitdiff
arm64: zynqmp: Check return value in zynqmp_mmio_rawwrite()
authorMichal Simek <michal.simek@xilinx.com>
Wed, 13 Jun 2018 08:38:33 +0000 (10:38 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 15 Jun 2018 06:54:05 +0000 (08:54 +0200)
There should be return value check from zynqmp_mmio_read() in
zynqmp_mmio_rawwrite() to make sure that errors are propagated properly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/cpu/armv8/zynqmp/cpu.c

index e122be59c747944cfc1b5b3e7a46bf7fdf10a1e0..1279dc8658a10c58204366bab9a26aa6cec3e101 100644 (file)
@@ -212,8 +212,12 @@ static int zynqmp_mmio_rawwrite(const u32 address,
 {
        u32 data;
        u32 value_local = value;
+       int ret;
+
+       ret = zynqmp_mmio_read(address, &data);
+       if (ret)
+               return ret;
 
-       zynqmp_mmio_read(address, &data);
        data &= ~mask;
        value_local &= mask;
        value_local |= data;