From patchwork Tue Nov 24 08:52:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M'boumba Cedric Madianga X-Patchwork-Id: 7688201 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4340ABF90C for ; Tue, 24 Nov 2015 08:53:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C0792081F for ; Tue, 24 Nov 2015 08:53:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A6894207C0 for ; Tue, 24 Nov 2015 08:53:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752573AbbKXIxe (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 Received: by wmww144 with SMTP id w144so128632377wmw.1; Tue, 24 Nov 2015 00:53:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=tBkAzjZQ3aTPEAOFPqU6fndZwER5Kf94Gt9GDMFje54=; b=xSk99gMTnOlah3xeHw5lhyzgPDa6qMHSNbIWchBZ7ACckGQSaL0U/t/WhH2lD42WR9 q1c/PLpqxLI8S2vQBvAzRynpSU9bnPJXYl3iyzqU5KjJNJkgXEoeCKn4oTPD6ufZ+zse z32pO2xWl62x8hxnQoKLbi2KupIOhuw3lM0Inp6CVPWf5aF+fT0CA7/SkfyJcb1lTbsO zSnbpn4mQt+QBm1ZsX1mfMb77d+p1/ouBl5Wyqkx92AGlrwIOFtMJ61yIQaVy1Drbivl S5rDWh3SBVckoJOZoFlCxVP2Nz7QldwV+pme/CLSX8Gjh9Pfr5DlacUe0O+h1afDf2sZ Q2gQ== X-Received: by 10.28.218.75 with SMTP id r72mr19044016wmg.59.1448355211986; Tue, 24 Nov 2015 00:53:31 -0800 (PST) Received: from lmenx29w.st.com. ([80.12.58.76]) by smtp.gmail.com with ESMTPSA id i84sm17116907wmc.20.2015.11.24.00.53.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Nov 2015 00:53:31 -0800 (PST) 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: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;