acpi/apei/erst: Add missing iounmap() on error in erst_exec_move_data()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 2 Jul 2013 01:02:32 +0000 (09:02 +0800)
committerTony Luck <tony.luck@intel.com>
Mon, 19 Aug 2013 17:13:30 +0000 (10:13 -0700)
Add the missing iounmap() before return from erst_exec_move_data()
in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
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);