All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: netxbig: Fix refcount leak in netxbig_leds_get_of_pdata
Date: Thu, 12 May 2022 08:53:24 +0200	[thread overview]
Message-ID: <20220512065323.GA8632@amd> (raw)
In-Reply-To: <20220512050253.8987-1-linmq006@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

Hi!

> of_parse_phandle() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not needed anymore.
> When of_find_device_by_node() fails, of_node_put() is missing.

Can you take a look at the code and simplify it? AFAICT the node_put
should go right after

       gpio_ext_pdev = of_find_device_by_node(gpio_ext_np);


. Best regards,
								Pavel
-- 
People of Russia, stop Putin before his war on Ukraine escalates.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

      reply	other threads:[~2022-05-12  6:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12  5:02 [PATCH] leds: netxbig: Fix refcount leak in netxbig_leds_get_of_pdata Miaoqian Lin
2022-05-12  6:53 ` Pavel Machek [this message]

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=20220512065323.GA8632@amd \
    --to=pavel@ucw.cz \
    --cc=linmq006@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@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.