From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Rob Herring <robh@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] of: dynamic: Fix potential memory leak in of_changeset_action()
Date: Fri, 8 Sep 2023 09:16:26 +0200 [thread overview]
Message-ID: <CAMuHMdVUQ1rZj_9TLd3qjZ2knRK0npnTME9ijiU8qkPnKbyqmA@mail.gmail.com> (raw)
In-Reply-To: <7dfaf999-30ad-491c-9615-fb1138db121c@moroto.mountain>
On Fri, Sep 8, 2023 at 9:03 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
> Smatch complains that the error path where "action" is invalid leaks
> the "ce" allocation:
> drivers/of/dynamic.c:935 of_changeset_action()
> warn: possible memory leak of 'ce'
>
> Fix this by doing the validation before the allocation.
>
> Fixes: 914d9d831e61 ("of: dynamic: Refactor action prints to not use "%pOF" inside devtree_lock")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/r/202309011059.EOdr4im9-lkp@intel.com/
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2023-09-08 7:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 7:03 [PATCH] of: dynamic: Fix potential memory leak in of_changeset_action() Dan Carpenter
2023-09-08 7:16 ` Geert Uytterhoeven [this message]
2023-09-08 15:18 ` Rob Herring
2023-09-08 15:34 ` Geert Uytterhoeven
2023-09-08 16:14 ` Dan Carpenter
2023-09-12 15:32 ` Rob Herring
2023-09-12 15:55 ` Geert Uytterhoeven
2023-09-13 6:28 ` Dan Carpenter
2023-09-13 12:44 ` Rob Herring
2023-09-11 14:58 ` Rob Herring
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=CAMuHMdVUQ1rZj_9TLd3qjZ2knRK0npnTME9ijiU8qkPnKbyqmA@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=dan.carpenter@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=robh@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;
as well as URLs for NNTP newsgroup(s).