Re: [PATCH] soundwire: fix usages of device_get_named_child_node()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



…
> 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





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux