Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1017042ybe; Wed, 4 Sep 2019 11:11:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUCxlH1EzU8u7i95WVgdXF+QeiYZWdkNeeY5dbfQJMXYQ0p8X2hDK7rjjHFnHYpq4z+N6X X-Received: by 2002:a63:b904:: with SMTP id z4mr35389045pge.388.1567620708080; Wed, 04 Sep 2019 11:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567620708; cv=none; d=google.com; s=arc-20160816; b=qDqmSfZmihM9b6EdqyAe3qNigdwgRId6tooKhZJetB9FDS0OhvsOOizcFqSJ0zRZmL mHaPU4wCSc/N+72NDlEEAzndlNSqtm8degAua3c+vOT+JuIOOynnKukDTHuCWpk7Vfr2 eUX0aRIhAA83PuDoeJ+OO+WEt7enJUCNPUXF46nnzg8g2iZaqpdihWNf+xb+lGslpb/E 207s9VO6aWDBWtoPjD2YzCFuiG26mc1+A1/Z31vi87UynuhTRPXJwb4b60k3byjvC7ZB ujRU7H4gjRgZMNg9blbEY0ATn+NO3SgxrZU58rtOTuh3anvoxPE9uiNcvYeC+hrao02j RDiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0RIxkvFLACHzfpzh0oycs+OM5/F0i7YEQATYIvTzf94=; b=TzsoimNLSxoaPUziBC1iI1uTVKB69guzzcsli8NMLS9/dMx5SrFbNEjQSxsd0A7PZ3 mDTPfd73JaaByamYXhSCOMJ2LqWpj7R7mbEqc9IwhPS5AKGC/FphbcE16RImE/CIsSyq dY8EgblotaMMD287Ce5FHuNeKZM8ewzhMrZLxWGF7OqKK89HsOf62CWu3+pXwa6DFX+k vWAQdDxynw+luzbvTkCGMQsAXYjZIAwo5WzrKMEsoDpf2dishx7XMNz2W++epX0xQGr2 mbVvmU1IC6nOsKHKy66d2YnV9gnRMGNB6FrPD/7mMOBhsRSrPJsp2ocYFFXbXyPE6J31 Iwaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="q63/JtLe"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b25si18726265pgl.270.2019.09.04.11.11.32; Wed, 04 Sep 2019 11:11:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="q63/JtLe"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390021AbfIDSJ7 (ORCPT + 99 others); Wed, 4 Sep 2019 14:09:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:53202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389995AbfIDSJv (ORCPT ); Wed, 4 Sep 2019 14:09:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 331FB206BA; Wed, 4 Sep 2019 18:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620590; bh=yMRiPjJCDCrWwaba189PEzv2WS8Kj1Ngv2uHAWDGFeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q63/JtLeWcxsDtVU/ZTI8YorSGSHMhqUgiwk4K/5nvBZrvKplOdpjSsjX1Ek1X2mV d+hIOAj/2z7X5mgOMSM1ItvWgsCcTsFHosnhmAuYOKfnCY7QODenRo9CP4erhH+3C5 0q3oTwQYfP+rM/1ym5cY2L6kd/kiX/EvSqHSSdDo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jia-Ju Bai , Vinod Koul , Sasha Levin Subject: [PATCH 5.2 022/143] dmaengine: stm32-mdma: Fix a possible null-pointer dereference in stm32_mdma_irq_handler() Date: Wed, 4 Sep 2019 19:52:45 +0200 Message-Id: <20190904175314.938721216@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 39c71a5b8212f4b502d9a630c6706ac723abd422 ] In stm32_mdma_irq_handler(), chan is checked on line 1368. When chan is NULL, it is still used on line 1369: dev_err(chan2dev(chan), "MDMA channel not initialized\n"); Thus, a possible null-pointer dereference may occur. To fix this bug, "dev_dbg(mdma2dev(dmadev), ...)" is used instead. Signed-off-by: Jia-Ju Bai Fixes: a4ffb13c8946 ("dmaengine: Add STM32 MDMA driver") Link: https://lore.kernel.org/r/20190729020849.17971-1-baijiaju1990@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/stm32-mdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c index d6e919d3936a2..1311de74bfdde 100644 --- a/drivers/dma/stm32-mdma.c +++ b/drivers/dma/stm32-mdma.c @@ -1366,7 +1366,7 @@ static irqreturn_t stm32_mdma_irq_handler(int irq, void *devid) chan = &dmadev->chan[id]; if (!chan) { - dev_err(chan2dev(chan), "MDMA channel not initialized\n"); + dev_dbg(mdma2dev(dmadev), "MDMA channel not initialized\n"); goto exit; } -- 2.20.1