All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jouni.hogander@unikie.com
Cc: netdev@vger.kernel.org, lukas.bulwahn@gmail.com
Subject: Re: [PATCH] net-sysfs: Fix memory leak in register_queue_kobjects
Date: Fri, 15 Nov 2019 12:21:19 -0800 (PST)	[thread overview]
Message-ID: <20191115.122119.1151591656300969166.davem@davemloft.net> (raw)
In-Reply-To: <20191114111325.2027-1-jouni.hogander@unikie.com>

From: jouni.hogander@unikie.com
Date: Thu, 14 Nov 2019 13:13:25 +0200

> +err_sysfs_create:
> +	kobject_put(kobj);
> +err_init_and_add:
> +	kfree_const(kobj->name);

If you put the object, then you cannot access kobj->name afterwards as kobj
may be released at this point.

Both of your fixes add this bug.

  reply	other threads:[~2019-11-15 20:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 11:13 [PATCH] net-sysfs: Fix memory leak in register_queue_kobjects jouni.hogander
2019-11-15 20:21 ` David Miller [this message]
2019-11-19  9:23 ` Jouni Högander

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=20191115.122119.1151591656300969166.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jouni.hogander@unikie.com \
    --cc=lukas.bulwahn@gmail.com \
    --cc=netdev@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 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.