All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Ioannis Valasakis <code@wizofe.uk>,
	outreachy-kernel@googlegroups.com, gregkh@linuxfoundation.org,
	rspringer@google.com
Subject: Re: [Outreachy kernel] [PATCH] staging: gasket Create a memory allocation path
Date: Mon, 29 Oct 2018 17:31:06 -0400	[thread overview]
Message-ID: <20181029213106.GP2015@sasha-vm> (raw)
In-Reply-To: <alpine.DEB.2.20.1810291512410.20217@hadrien>

On Mon, Oct 29, 2018 at 03:14:56PM +0100, Julia Lawall wrote:
>> +err_alloc:
>> +	kfree(interrupt_data);
>> +	kfree(interrupt_data->msix_entries);
>> +	kfree(interrupt_data->eventfd_ctxs);
>> +	return -ENOMEM;
>
>Besides Vaishali's suggestion, could you also make specific tags for
>specific cases?  Please first read this message from Dan Carpenter:
>
>https://plus.google.com/106378716002406849458/posts/dnanfhQ4mHQ

You'll also notice that you made the very same mistake Dan describes in
his post :)

You first freed interrupt_data, and proceeded to try and free
interrupt_data->msix_entries, which will attempt to dereference
interrupt_data which you freed the line before.

--
Thanks,
Sasha


  reply	other threads:[~2018-10-29 21:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 14:07 [PATCH] staging: gasket Create a memory allocation path Ioannis Valasakis
2018-10-29 14:09 ` [Outreachy kernel] " Vaishali Thakkar
2018-10-29 14:14 ` Julia Lawall
2018-10-29 21:31   ` Sasha Levin [this message]
2018-10-29 14:31 ` Greg KH
2018-10-30 13:41   ` Ioannis Valasakis

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=20181029213106.GP2015@sasha-vm \
    --to=sashal@kernel.org \
    --cc=code@wizofe.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=julia.lawall@lip6.fr \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=rspringer@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.