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

From: Jean Delvare
Date: Wed Apr 16 2025 - 08:04:57 EST


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@xxxxxxxxxxxxxxx
> Cc: Jean Delvare <jdelvare@xxxxxxx>
> Signed-off-by: Andrew Jeffery <andrew@xxxxxxxxxxxxxxxxxxxx>
> ---
> 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@xxxxxxx>

--
Jean Delvare
SUSE L3 Support