Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753121AbbKXIxe (ORCPT ); Tue, 24 Nov 2015 03:53:34 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:36351 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752402AbbKXIxd (ORCPT ); Tue, 24 Nov 2015 03:53:33 -0500 From: "M'boumba Cedric Madianga" To: mcoquelin.stm32@gmail.com, dan.j.williams@intel.com, vinod.koul@intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Cc: "M'boumba Cedric Madianga" Subject: [PATCH] dmaengine: stm32-dma: Fix static checker warning Date: Tue, 24 Nov 2015 09:52:35 +0100 Message-Id: <1448355155-31283-1-git-send-email-cedric.madianga@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1000 Lines: 30 This patch fix an unchecked dereference warning by returning operation not permitted when stm32_dma_start_transfer() does not succeed to allocate a virtual channel descriptor. Signed-off-by: M'boumba Cedric Madianga --- drivers/dma/stm32-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c index 12f3a3e..0214bcf 100644 --- a/drivers/dma/stm32-dma.c +++ b/drivers/dma/stm32-dma.c @@ -437,7 +437,7 @@ static int stm32_dma_start_transfer(struct stm32_dma_chan *chan) if (!chan->desc) { vdesc = vchan_next_desc(&chan->vchan); if (!vdesc) - return 0; + return -EPERM; chan->desc = to_stm32_dma_desc(vdesc); chan->next_sg = 0; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/