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>
This commit is contained in:
Peiwei Hu 2021-12-28 16:59:10 +08:00 committed by Guenter Roeck
parent f103b2e5a6
commit 660d187887
1 changed files with 4 additions and 2 deletions

View File

@ -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;