linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geliang Tang <geliangtang@gmail.com>
To: Ivan Hu <ivan.hu@canonical.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] efi/efi_test: drop useless kfree
Date: Tue, 2 May 2017 22:48:35 +0800	[thread overview]
Message-ID: <20170502144835.3jpwrdw6shnfr5g2@ThinkPad> (raw)
In-Reply-To: <a8b99581-70e3-bf9a-bf62-4b13a8cc292c@canonical.com>

On Tue, May 02, 2017 at 03:11:45PM +0800, ivanhu wrote:
> 
> 
> 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@gmail.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"?
> 

Sorry, it's my mistake. The original code is correct. Please ignore this
patch.

-Geliang

> Cheers,
> Ivan
> 
> > +	if (IS_ERR(data))
> >   		return PTR_ERR(data);
> > -	}
> >   	status = efi.set_variable(name, &vendor_guid,
> >   				setvariable.attributes,

  reply	other threads:[~2017-05-02 14:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-29  1:42 [PATCH 1/2] efi/efi_test: use memdup_user Geliang Tang
2017-04-29  1:42 ` [PATCH 2/2] efi/efi_test: drop useless kfree Geliang Tang
2017-05-02  7:11   ` ivanhu
2017-05-02 14:48     ` Geliang Tang [this message]
2017-05-05 20:53 ` [PATCH 1/2] efi/efi_test: use memdup_user Matt Fleming
2017-05-08  8:18   ` ivanhu
2017-05-10 10:35     ` Matt Fleming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170502144835.3jpwrdw6shnfr5g2@ThinkPad \
    --to=geliangtang@gmail.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=ivan.hu@canonical.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).