Re: [PATCH] efi, pstore: Cocci spatch "memdup.spatch"

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

 



On Sat, Jun 1, 2013 at 2:40 AM, Thomas Meyer <thomas@xxxxxxxx> wrote:
>
> Signed-off-by: Thomas Meyer <thomas@xxxxxxxx>

Acked-by: Kees Cook <keescook@xxxxxxxxxxxx>

Thanks!

-Kees

> ---
>
> diff -u -p a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c
> --- a/drivers/firmware/efi/efi-pstore.c
> +++ b/drivers/firmware/efi/efi-pstore.c
> @@ -79,10 +79,9 @@ static int efi_pstore_read_func(struct e
>                            &entry->var.DataSize, entry->var.Data);
>         size = entry->var.DataSize;
>
> -       *cb_data->buf = kmalloc(size, GFP_KERNEL);
> +       *cb_data->buf = kmemdup(entry->var.Data, size, GFP_KERNEL);
>         if (*cb_data->buf == NULL)
>                 return -ENOMEM;
> -       memcpy(*cb_data->buf, entry->var.Data, size);
>         return size;
>  }
>
>
>
>



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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux