Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1456922rdb; Sat, 3 Feb 2024 07:04:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTl9caXbJ6zc28kqNUyD0RGajBvHB5xW8h6DoqFyjW1PuuXW4nguXr3K3sUWK6MmrXZmPD X-Received: by 2002:a6b:d80b:0:b0:7be:ec9d:1234 with SMTP id y11-20020a6bd80b000000b007beec9d1234mr5130351iob.19.1706972666448; Sat, 03 Feb 2024 07:04:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706972666; cv=pass; d=google.com; s=arc-20160816; b=yk+XaJGWL1LTAim4v9do9IiaR2gLSGHhiHhym8GTZS9j9X/n7FxDuApEWBoXAYZS4K OiPqjuQ5aC8x81Y4zS+GgsY2LtAOMVygVeRt11em9H4fCpLbF/NH2ca9Kd+LWPYmXifb C7gT+5LJdzFfG+phRStsJOYWyN0AFTgeVx/TTghrJMaxlK1wax4SykQHRF98KdjuqQ55 TP3oPVwdMHlV60c3/EoG6DaWJ6Tx4NF0fRB6tXYf3anatryD0l2nGMe5TlYnLUIvRJlY BAQVZ/u2gYed3bh7XjwPXTKZFj5Exj/u5uBLDWcG1NPQOf4xyLpezm/JS3nQt/qzXI/O SM0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=LWaLolZLVHoMja/NNNmsmRp6PTzwtZ8CVFd3EvB8tPA=; fh=fclTCrLXnR0zoVrfAszEwj0SuygQoLHmVvaVVVAqFL4=; b=B7Bcd/SssEsUygilI9bU6/XWcggdwTVYfrvO2xWIHrCxpy6tIq/f+K2MnwCfTUMFLj M1AmiINqZ5EUtLRbAuLj49pmRNdM9Ym79Y/qqKg2dGrRx3TadWqSdQiPqZmUgvWkD2Xp z/+cD//uC2ArJy2Xk0t+1s/vlZxINwPSLL+bi02dNlKbcH53F8s0LN3UY0a0Ngvrz/mZ MD8V0aJWehBWv/QmESimi2iEEfmxSIC4oGdsVBRCZijCM+lZe3gMv0A/4O3m13fk2WPA tYmuerOC1XG6XINdDFqKKRfogrdz0l9bMxxg8IfZrxZOGWLm/HkAqAFP3eRqbszAwFbM H+CA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=C3eu6XJy; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-51135-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51135-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru X-Forwarded-Encrypted: i=1; AJvYcCUDkcJ652HSkicUr11V7r/eBj9roBMWAC9T6KdckGb94Mj8DjvDTaqaSyh5DB/WHYBk64Ok3Ft1G2GJCS4mGIHujc9JkSGlUmiOM9RGXw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a12-20020a631a0c000000b005d728a3319csi3205362pga.135.2024.02.03.07.04.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 07:04:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51135-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=C3eu6XJy; arc=pass (i=1 spf=pass spfdomain=ispras.ru dkim=pass dkdomain=ispras.ru dmarc=pass fromdomain=ispras.ru); spf=pass (google.com: domain of linux-kernel+bounces-51135-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51135-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 177D82853D4 for ; Sat, 3 Feb 2024 15:04:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 795B45EE9B; Sat, 3 Feb 2024 15:04:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b="C3eu6XJy" Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 594F95EE86; Sat, 3 Feb 2024 15:04:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.149.199.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706972656; cv=none; b=U1jGYaMk1xpYOrtVnGQpbccdcLxkyEHx+bYnLoMc/857t0KJ2IkIdXHUblRE0X1myTwULXfPRvqgSUPr6RPj4tWjGpOk/iG2WEKacwSeePofCuAhG8DxoOPTMeQFPQ6rjQKb9dJYsqlholcSBIB+cE5JuUz6QRXkxht76HPZExk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706972656; c=relaxed/simple; bh=2GLWDPQIEiSm6KySEb3j7J+GjSJV+EXcOoENDX6iZHA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=m3qxAu4zhj8IN4ohUJ5X9sU8Y6D00wM7H9FZfp8fb/9c2p9/Tgb5wPrrFua3sLWwNAJ1qUttS726t9CBDCGb1z2BZUMpsalwR5lkqKMnEkLE26RukwONrbPTzG0G3KqU564tb8GbMQs84xMRrkbQRXqOlGXkHnPpReti2QxcHYc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru; spf=pass smtp.mailfrom=ispras.ru; dkim=pass (1024-bit key) header.d=ispras.ru header.i=@ispras.ru header.b=C3eu6XJy; arc=none smtp.client-ip=83.149.199.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ispras.ru Received: from localhost.localdomain (unknown [85.89.126.105]) by mail.ispras.ru (Postfix) with ESMTPSA id 1D2E440F1DC6; Sat, 3 Feb 2024 15:04:04 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 1D2E440F1DC6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1706972644; bh=LWaLolZLVHoMja/NNNmsmRp6PTzwtZ8CVFd3EvB8tPA=; h=From:To:Cc:Subject:Date:From; b=C3eu6XJyaDUjR+G0C86mQ6ZfmK67QE9aFBH75t4eJo3MG0wzROpenuGRldhsUG4ya bJDGjp7dsn6YzyhElq58earXsrx1xa1OQfmp3tZa4EUTtBonJaKLW5gkzcCyWyzWIl +ryFZYP87zIgqKq665ykwGQdkm19rjtYVL7cCh9w= From: Pavel Sakharov To: Alexandre Torgue Cc: Pavel Sakharov , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, Alexey Khoroshilov Subject: [PATCH] stmmac: Fix incorrect dereference in stmmac_*_interrupt() Date: Sat, 3 Feb 2024 18:03:21 +0300 Message-ID: <20240203150323.1041736-1-p.sakharov@ispras.ru> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If 'dev' is NULL, the 'priv' variable has an incorrect address when dereferencing calling netdev_err(). Pass 'dev' instead of 'priv->dev" to the function. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Pavel Sakharov --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 4727f7be4f86..5ab5148013cd 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5848,7 +5848,7 @@ static irqreturn_t stmmac_mac_interrupt(int irq, void *dev_id) struct stmmac_priv *priv = netdev_priv(dev); if (unlikely(!dev)) { - netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__); + netdev_err(dev, "%s: invalid dev pointer\n", __func__); return IRQ_NONE; } @@ -5868,7 +5868,7 @@ static irqreturn_t stmmac_safety_interrupt(int irq, void *dev_id) struct stmmac_priv *priv = netdev_priv(dev); if (unlikely(!dev)) { - netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__); + netdev_err(dev, "%s: invalid dev pointer\n", __func__); return IRQ_NONE; }