Re: [PATCH 1/7] soc: aspeed: lpc-snoop: Cleanup resources in stack-order

Jean Delvare
2025-04-16T12:04:01Z

On Fri, 11 Apr 2025 10:38:31 +0930, Andrew Jeffery wrote:
> Free the kfifo after unregistering the miscdev in
> aspeed_lpc_disable_snoop() as the kfifo is initialised before the
> miscdev in aspeed_lpc_enable_snoop().
>
> Fixes: 3772e5da4454 ("drivers/misc: Aspeed LPC snoop output using misc chardev")
> Cc: stable@vger.kernel.org
> Cc: Jean Delvare <jdelvare@suse.de>
> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
> ---
> drivers/soc/aspeed/aspeed-lpc-snoop.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c
> index 3e3f178b122615b33e10ff25a0b0fe7b40a0b667..bfa770ec51a889260d11c26e675f3320bf710a54 100644
> --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c
> +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c
> @@ -263,8 +263,8 @@ static void aspeed_lpc_disable_snoop(struct aspeed_lpc_snoop *lpc_snoop,
> return;
> }
>
> - kfifo_free(&lpc_snoop->chan[channel].fifo);
> misc_deregister(&lpc_snoop->chan[channel].miscdev);
> + kfifo_free(&lpc_snoop->chan[channel].fifo);
> }
>
> static int aspeed_lpc_snoop_probe(struct platform_device *pdev)
>

Acked-by: Jean Delvare <jdelvare@suse.de>

--
Jean Delvare
SUSE L3 Support