Skip to content

Commit

Permalink
hwmon: (xgene-hwmon) Add free before exiting xgene_hwmon_probe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peiwei Hu authored and Guenter Roeck committed Dec 28, 2021
1 parent f103b2e commit 660d187
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/hwmon/xgene-hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 660d187

Please sign in to comment.