Re: [PATCH] pata_ep93xx: fix possible NULL pointer dereference in ep93xx_pata_release_dma()

Chen Changcheng <[email protected]> Thu, 16 Jul 2026 10:31:51 +0800
Newsgroups gmane.linux.ide,gmane.linux.kernel
Message-ID <[email protected]>
>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

Thanks for the review. 
I agree that IS_ERR_OR_NULL() is not the right
approach. Please drop this patch.

Chen Changcheng