From 4c4d7f878589585d32b81aab6ed4a5066fae1091 Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Thu, 7 Apr 2016 16:49:43 +0300 Subject: [PATCH] dmaengine: core: Revert back to pr_debug in __dma_request_channel() Commit ef859312c3a1 ("dmaengine: core: Use dev_ functions for debug and error prints") wasn't quite right in __dma_request_channel() by claiming that all pr_ prints have valid DMA channel pointer. Obviously it is not true as __dma_request_channel() is looking for a channel and returns NULL if it does not find it. Prevent this potential NULL pointer dereference by reverting back to pr_debug(). Signed-off-by: Jarkko Nikula Reported-by: Dan Carpenter Signed-off-by: Vinod Koul --- drivers/dma/dmaengine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index a7131d4141d8..ca1400d66957 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -664,7 +664,7 @@ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, } mutex_unlock(&dma_list_mutex); - dev_dbg(chan->device->dev, "%s: %s (%s)\n", + pr_debug("%s: %s (%s)\n", __func__, chan ? "success" : "fail", chan ? dma_chan_name(chan) : NULL);