All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>,
	vkoul@kernel.org, yung-chuan.liao@linux.intel.com
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] soundwire: mipi_disco: Put fwnode on property array read errors
Date: Thu, 12 Nov 2026 09:10:50 +0100	[thread overview]
Message-ID: <530744dd-da1c-4c60-b344-67e8f895b28f@linux.dev> (raw)
In-Reply-To: <20261112060943.1916-1-laixiangwu@cmss.chinamobile.com>

On 11/12/26 07:09, Xiangwu Lai wrote:
> sdw_master_read_prop() and sdw_slave_read_dpn() take a fwnode
> reference with device_get_named_child_node() and already release it
> on the -ENOMEM and success paths.  However, the error paths added
> for the property array reads jump straight out without dropping the
> reference, leaking it on every failed read.  The lane-list support
> in sdw_slave_read_dpn() is even missing the put on its -ENOMEM path,
> unlike the other array allocations in the same function.
> 
> Release the reference on those error paths as well, matching the
> existing -ENOMEM handling in the same functions.
> 
> Fixes: a489afc105ed ("soundwire: mipi-disco: add error handling for property array read")
> Fixes: 71b405b18444 ("soundwire: mipi-disco: add support for DP0/DPn 'lane-list' property")
> Signed-off-by: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
> ---
> Changes in v2:
> 
> - Fix the subject of the first Fixes tag to match the commit title
>   ("mipi-disco" instead of "mipi_disco") and add a second Fixes tag
>   for the lane-list error paths, which were introduced by a different
>   commit and also cover the missing put on the lane-list -ENOMEM
>   path (suggested by Sashiko AI review).
> - Note: an earlier attempt to fix these leaks using __free() was
>   posted in 2024 but never merged:
>   https://lore.kernel.org/all/20241019-mipi_disco-of_node_put-v1-1-1de27e6852c4@gmail.com/

Thanks for the patch, the existing code is indeed inconsistent. LGTM.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>



      reply	other threads:[~2026-11-12  8:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  6:09 [PATCH v2] soundwire: mipi_disco: Put fwnode on property array read errors Xiangwu Lai
2026-11-12  8:10 ` Pierre-Louis Bossart [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=530744dd-da1c-4c60-b344-67e8f895b28f@linux.dev \
    --to=pierre-louis.bossart@linux.dev \
    --cc=laixiangwu@cmss.chinamobile.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.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.