acpi/apei/erst: Add missing iounmap() on error in erst_exec_move_data()
[firefly-linux-kernel-4.4.55.git] / drivers / acpi / apei / erst.c
index 88d0b0f9f92b73706e330e62a4bcf70dd4b0befa..6885809abcd8e283ed32425c7a508df3ac9c9d6f 100644 (file)
@@ -284,8 +284,10 @@ static int erst_exec_move_data(struct apei_exec_context *ctx,
        if (!src)
                return -ENOMEM;
        dst = ioremap(ctx->dst_base + offset, ctx->var2);
-       if (!dst)
+       if (!dst) {
+               iounmap(src);
                return -ENOMEM;
+       }
 
        memmove(dst, src, ctx->var2);