]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: adc: pac1921: Move ACPI_FREE() to cover all branches
authorVictor Duicu <victor.duicu@microchip.com>
Fri, 17 Jan 2025 06:53:14 +0000 (08:53 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 3 Feb 2025 19:30:10 +0000 (19:30 +0000)
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>
drivers/iio/adc/pac1921.c

index 90f61c47b1c46fb5a0fd4346345982aaa0a90972..63f51821515658a1339082717f0c7bdf775e1da9 100644 (file)
@@ -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;
 }