dmaengine: fix NULL pointer in channel unregistration function
[platform/kernel/linux-starfive.git] / drivers / dma / dmaengine.c
index b7388ae..491b222 100644 (file)
@@ -1103,6 +1103,9 @@ EXPORT_SYMBOL_GPL(dma_async_device_channel_register);
 static void __dma_async_device_channel_unregister(struct dma_device *device,
                                                  struct dma_chan *chan)
 {
+       if (chan->local == NULL)
+               return;
+
        WARN_ONCE(!device->device_release && chan->client_count,
                  "%s called while %d clients hold a reference\n",
                  __func__, chan->client_count);