public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: David Woodhouse <David.Woodhouse@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Comment added in 63662139e "params: Fix potential memory leak in add_sysfs_param()"
Date: Fri, 21 Mar 2014 13:46:56 +0100	[thread overview]
Message-ID: <878us367nj.fsf@rasmusvillemoes.dk> (raw)

Hi,

I'm not at all convinced by the comment added in commit
63662139e519ce. If krealloc(attrs, ...) fails, nothing seems to free attrs;
the krealloc() call certainly doesn't do it. If attrs was NULL to begin
with, no harm done, but otherwise it is "attrs = mk->mp->grp.attrs;",
and mk->mp is NULL'ed on the error path fail_free_new: (and the value of
mk->mp is anyway invalidated by the krealloc() above).

Am I missing something?

Rasmus

                 reply	other threads:[~2014-03-21 12:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=878us367nj.fsf@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=David.Woodhouse@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /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