Re: [PATCH] ata: pata_ep93xx: fix double-free of DMA channel on error path
From: Arnd Bergmann
Date: Wed Jul 08 2026 - 07:05:41 EST
On Wed, Jul 8, 2026, at 11:27, Chen Changcheng wrote:
> static void ep93xx_pata_release_dma(struct ep93xx_pata_data *drv_data)
> {
> - if (drv_data->dma_rx_channel) {
> + if (!IS_ERR_OR_NULL(drv_data->dma_rx_channel)) {
> dma_release_channel(drv_data->dma_rx_channel);
> drv_data->dma_rx_channel = NULL;
> }
If something requires you to use IS_ERR_OR_NULL(), that is usually
a bad API design, and you should fix this at the place where
it gets introduced.
Please fix the probe path instead so it doesn't try to use the
device without a valid channel.
Arnd