Re: [PATCH] clocksource: clps711x: Fix resource leaks in error paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> The current implementation of clps711x_timer_init() has multiple error
> paths that directly return without releasing the base I/O memory mapped

How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16#n145


> via of_iomap(). This leads to resource leaks when:

Please reconsider the need for the presented enumeration once more.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16#n94


…
> +++ b/drivers/clocksource/clps711x-timer.c
> @@ -78,24 +78,34 @@ static int __init clps711x_timer_init(struct device_node *np)
…
> -	return 0;
> +out:
> +	if (base)


* I suggest to omit such a pointer check because it was performed already
  directly after the of_iomap() call.

* Would it be nicer to use the label “unmap_io”?


> +		iounmap(base);
> +	return ret;
>  }
>  TIMER_OF_DECLARE(clps711x, "cirrus,ep7209-timer", clps711x_timer_init);
…

Regards,
Markus





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux