linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: add free before exiting xgene_hwmon_probe
@ 2021-12-28  8:59 Peiwei Hu
  2021-12-28 16:05 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Peiwei Hu @ 2021-12-28  8:59 UTC (permalink / raw)
  To: jdelvare, linux; +Cc: linux-hwmon, linux-kernel, trivial, Peiwei Hu

do kfifo_free(&ctx->async_msg_fifo) before error exiting
instead of returning directly.

Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com>
---
 drivers/hwmon/xgene-hwmon.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
index 30aae8642069..5cde837bfd09 100644
--- a/drivers/hwmon/xgene-hwmon.c
+++ b/drivers/hwmon/xgene-hwmon.c
@@ -659,8 +659,10 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
 
 		acpi_id = acpi_match_device(pdev->dev.driver->acpi_match_table,
 					    &pdev->dev);
-		if (!acpi_id)
-			return -EINVAL;
+		if (!acpi_id) {
+			rc = -EINVAL;
+			goto out_mbox_free;
+		}
 
 		version = (int)acpi_id->driver_data;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwmon: add free before exiting xgene_hwmon_probe
  2021-12-28  8:59 [PATCH] hwmon: add free before exiting xgene_hwmon_probe Peiwei Hu
@ 2021-12-28 16:05 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-12-28 16:05 UTC (permalink / raw)
  To: Peiwei Hu; +Cc: jdelvare, linux-hwmon, linux-kernel, trivial

On Tue, Dec 28, 2021 at 04:59:10PM +0800, Peiwei Hu wrote:
> do kfifo_free(&ctx->async_msg_fifo) before error exiting
> instead of returning directly.
> 

Applied, but please reference the driver in the subject line
of future patches.

Guenter

> Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com>
> ---
>  drivers/hwmon/xgene-hwmon.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
> index 30aae8642069..5cde837bfd09 100644
> --- a/drivers/hwmon/xgene-hwmon.c
> +++ b/drivers/hwmon/xgene-hwmon.c
> @@ -659,8 +659,10 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
>  
>  		acpi_id = acpi_match_device(pdev->dev.driver->acpi_match_table,
>  					    &pdev->dev);
> -		if (!acpi_id)
> -			return -EINVAL;
> +		if (!acpi_id) {
> +			rc = -EINVAL;
> +			goto out_mbox_free;
> +		}
>  
>  		version = (int)acpi_id->driver_data;
>  

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-28 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28  8:59 [PATCH] hwmon: add free before exiting xgene_hwmon_probe Peiwei Hu
2021-12-28 16:05 ` Guenter Roeck

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).