mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3] iio: adc: pac1921: Move ACPI_FREE() to cover all branches
@ 2025-01-17  6:53 victor.duicu
  2025-01-17 14:36 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: victor.duicu @ 2025-01-17  6:53 UTC (permalink / raw)
  To: matteomartelli3, andy.shevchenko, jic23, lars
  Cc: victor.duicu, marius.cristea, linux-iio, linux-kernel

From: Victor Duicu <victor.duicu@microchip.com>

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

This patch ensures that status is freed before
exiting the function.

Differences related to previous versions:
v3:
- add parentheses to function names.

v2:
- add Fixes tag.
- remove unnecessary blank line.

v1:
- initial version for review.

 drivers/iio/adc/pac1921.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

base-commit: 577a66e2e634f712384c57a98f504c44ea4b47da
-- 
2.45.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] iio: adc: pac1921: Move ACPI_FREE() to cover all branches
  2025-01-17  6:53 [PATCH v3] iio: adc: pac1921: Move ACPI_FREE() to cover all branches victor.duicu
@ 2025-01-17 14:36 ` Andy Shevchenko
  2025-01-18 12:27   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2025-01-17 14:36 UTC (permalink / raw)
  To: victor.duicu
  Cc: matteomartelli3, jic23, lars, marius.cristea, linux-iio, linux-kernel

On Fri, Jan 17, 2025 at 8:55 AM <victor.duicu@microchip.com> wrote:
>
> From: Victor Duicu <victor.duicu@microchip.com>
>
> This patch moves ACPI_FREE() in pac1921_match_acpi_device()
> in order to cover all branches.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] iio: adc: pac1921: Move ACPI_FREE() to cover all branches
  2025-01-17 14:36 ` Andy Shevchenko
@ 2025-01-18 12:27   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2025-01-18 12:27 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: victor.duicu, matteomartelli3, lars, marius.cristea, linux-iio,
	linux-kernel

On Fri, 17 Jan 2025 16:36:08 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Fri, Jan 17, 2025 at 8:55 AM <victor.duicu@microchip.com> wrote:
> >
> > From: Victor Duicu <victor.duicu@microchip.com>
> >
> > This patch moves ACPI_FREE() in pac1921_match_acpi_device()
> > in order to cover all branches.  
> 
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> 
We are at an odd point in the cycle where my fixes branch
has an odd base so I can't push it out without messing up linux-next.

So applied, but you can't see it yet.  That will all unwind during
the merge window

Thanks,

Jonathan



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-18 12:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-17  6:53 [PATCH v3] iio: adc: pac1921: Move ACPI_FREE() to cover all branches victor.duicu
2025-01-17 14:36 ` Andy Shevchenko
2025-01-18 12:27   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®