Kernel-Janitors Archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] soundwire: fix usages of device_get_named_child_node()
       [not found] <20240429004935.2400191-1-yung-chuan.liao@linux.intel.com>
@ 2024-04-29 11:31 ` Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2024-04-29 11:31 UTC (permalink / raw
  To: Bard Liao, Pierre-Louis Bossart, linux-sound, kernel-janitors,
	Vinod Koul
  Cc: LKML, Bard Liao, Vinod Koul

…
> Add fwnode_handle_put() to avoid leaked references.

                          calls?

Would you like to add the tag “Fixes” accordingly?


…
> +++ b/drivers/soundwire/mipi_disco.c
> @@ -236,8 +244,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave,
>  						       dpn[i].num_channels,
>  						       sizeof(*dpn[i].channels),
>  						 GFP_KERNEL);
> -			if (!dpn[i].channels)
> +			if (!dpn[i].channels) {
> +				fwnode_handle_put(node);
>  				return -ENOMEM;
> +			}
>
>  			fwnode_property_read_u32_array(node,
>  					"mipi-sdw-channel-number-list",
> @@ -251,8 +261,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave,
>  					dpn[i].num_ch_combinations,
>  					sizeof(*dpn[i].ch_combinations),
>  					GFP_KERNEL);
> -			if (!dpn[i].ch_combinations)
> +			if (!dpn[i].ch_combinations) {
> +				fwnode_handle_put(node);
>  				return -ENOMEM;
> +			}
>
>  			fwnode_property_read_u32_array(node,
>  					"mipi-sdw-channel-combination-list",
…

* Would you like to complete the exception handling by using goto chains?

* How do you think about to increase the application of scope-based resource management?


Regards,
Markus

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-29 11:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240429004935.2400191-1-yung-chuan.liao@linux.intel.com>
2024-04-29 11:31 ` [PATCH] soundwire: fix usages of device_get_named_child_node() Markus Elfring

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 read-only IMAP folder(s) and NNTP newsgroup(s).