[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a8b99581-70e3-bf9a-bf62-4b13a8cc292c@canonical.com>
Date: Tue, 2 May 2017 15:11:45 +0800
From: ivanhu <ivan.hu@...onical.com>
To: Geliang Tang <geliangtang@...il.com>
Cc: Matt Fleming <matt@...eblueprint.co.uk>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] efi/efi_test: drop useless kfree
On 04/29/2017 09:42 AM, Geliang Tang wrote:
> Drop useless kfree when memdup_user() failed, since we have already
> called kfree in memdup_user().
>
> Signed-off-by: Geliang Tang <geliangtang@...il.com>
> ---
> drivers/firmware/efi/test/efi_test.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c
> index 08129b7..00332ae 100644
> --- a/drivers/firmware/efi/test/efi_test.c
> +++ b/drivers/firmware/efi/test/efi_test.c
> @@ -261,10 +261,8 @@ static long efi_runtime_set_variable(unsigned long arg)
> }
>
> data = memdup_user(setvariable.data, setvariable.data_size);
> - if (IS_ERR(data)) {
> - kfree(name);
You mean "name" or "data"?
Cheers,
Ivan
> + if (IS_ERR(data))
> return PTR_ERR(data);
> - }
>
> status = efi.set_variable(name, &vendor_guid,
> setvariable.attributes,
Powered by blists - more mailing lists