Re: [PATCH] drivers/clocksource/qcom: Add missing iounmap() on error when reading clock frequency.

From: Ankit Agrawal
Date: Thu Jul 11 2024 - 01:49:52 EST


On Wed, Jul 10, 2024 at 01:54:01PM +0200, Konrad Dybcio wrote:
> On 10.07.2024 1:08 PM, Ankit Agrawal wrote:
> > Add the missing iounmap() when clock frequency fails to get read by the
> > of_property_read_u32() call.
> >
> > Signed-off-by: Ankit Agrawal <agrawal.ag.ankit@xxxxxxxxx>
> > ---
>
> Or even better, you can extract:
>
> drivers/platform/x86/intel/pmc/core_ssram.c
> 32:DEFINE_FREE(pmc_core_iounmap, void __iomem *, iounmap(_T));
>
> into a common header, call it something less intel-specific and use
> it with __free() here

Can you please give a place where adding it would be appropriate? I am
new to contributing here, so any guidance on where to add the
DEFINE_FREE would be really helpful!

Also, just trying to think out loud. Will the cpu0_base pointer (and
also the source_base pointer) be required once this function exits? If
so, I think I will also need to use no_free_ptr() to ensure that the
memory doesn't get iounmap-ed once the function exits.

Thanks!
Ankit