Re: [PATCH] efi_pstore: add missing iounmap() on error in erst_exec_move_data()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 1, 2013 at 6:02 PM, Wei Yongjun <weiyj.lk@xxxxxxxxx> wrote:
> From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
>
> Add the missing iounmap() before return from erst_exec_move_data()
> in the error handling case.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
> ---
>  drivers/acpi/apei/erst.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
> index f7b3b39..7af21ed 100644
> --- a/drivers/acpi/apei/erst.c
> +++ b/drivers/acpi/apei/erst.c
> @@ -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);

Good catch!

Acked-by: Kees Cook <keescook@xxxxxxxxxxxx>

Thanks,

-Kees

--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux