Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: aspeed: lpc-snoop: Cleanup resources in stack-order

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>
Acked-by: Jean Delvare <jdelvare@suse.de>
Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-1-3cdd59c934d3@codeconstruct.com.au
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>

+1 -1
+1 -1
drivers/soc/aspeed/aspeed-lpc-snoop.c
··· 263 263 return; 264 264 } 265 265 266 - kfifo_free(&lpc_snoop->chan[channel].fifo); 267 266 misc_deregister(&lpc_snoop->chan[channel].miscdev); 267 + kfifo_free(&lpc_snoop->chan[channel].fifo); 268 268 } 269 269 270 270 static int aspeed_lpc_snoop_probe(struct platform_device *pdev)