summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Duicu <victor.duicu@microchip.com>2025-01-17 08:53:14 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-02-03 19:30:10 +0000
commit34d93804199fea23da2645dde35d0feb38a5d445 (patch)
treec38aa59b466cfb3cb07469258a30377b3842378e
parenta96d3e2beca0e51c8444d0a3b6b3ec484c4c5a8f (diff)
iio: adc: pac1921: Move ACPI_FREE() to cover all branches
This patch moves ACPI_FREE() in pac1921_match_acpi_device() in order to cover all branches. Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com> Fixes: 9fdf1d033316 ("iio: adc: pac1921: Add ACPI support to Microchip pac1921") Acked-by: Matteo Martelli <matteomartelli3@gmail.com> Signed-off-by: Victor Duicu <victor.duicu@microchip.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://patch.msgid.link/20250117065314.4431-1-victor.duicu@microchip.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/pac1921.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/pac1921.c b/drivers/iio/adc/pac1921.c
index 90f61c47b1c4..63f518215156 100644
--- a/drivers/iio/adc/pac1921.c
+++ b/drivers/iio/adc/pac1921.c
@@ -1198,11 +1198,11 @@ static int pac1921_match_acpi_device(struct iio_dev *indio_dev)
label = devm_kstrdup(dev, status->package.elements[0].string.pointer,
GFP_KERNEL);
+ ACPI_FREE(status);
if (!label)
return -ENOMEM;
indio_dev->label = label;
- ACPI_FREE(status);
return 0;
}