[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_C851C0324431466CBC22D60C5C6AC4A8E808@qq.com>
Date: Tue, 28 Dec 2021 16:59:10 +0800
From: Peiwei Hu <jlu.hpw@...mail.com>
To: jdelvare@...e.com, linux@...ck-us.net
Cc: linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
trivial@...nel.org, Peiwei Hu <jlu.hpw@...mail.com>
Subject: [PATCH] hwmon: add free before exiting xgene_hwmon_probe
do kfifo_free(&ctx->async_msg_fifo) before error exiting
instead of returning directly.
Signed-off-by: Peiwei Hu <jlu.hpw@...mail.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
Powered by blists - more mailing lists