summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorPeiwei Hu <jlu.hpw@foxmail.com>2021-12-28 11:59:10 +0300
committerGuenter Roeck <linux@roeck-us.net>2021-12-28 19:04:10 +0300
commit660d187887cf28bcd71e56008a71657811953189 (patch)
tree9d7bfc51d097bd1ec36c952970cda7947986acbf /drivers/hwmon
parentf103b2e5a6197586effb0b9a1b72c30b5d65b0cd (diff)
downloadlinux-660d187887cf28bcd71e56008a71657811953189.tar.xz
hwmon: (xgene-hwmon) Add free before exiting xgene_hwmon_probe
Call kfifo_free(&ctx->async_msg_fifo) before error exiting instead of returning directly. Signed-off-by: Peiwei Hu <jlu.hpw@foxmail.com> Link: https://lore.kernel.org/r/tencent_C851C0324431466CBC22D60C5C6AC4A8E808@qq.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/xgene-hwmon.c6
1 files 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;