From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
Maxim Petrov <mmrmaximuzz@gmail.com>,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH AUTOSEL 5.6 124/606] stmmac: fix pointer check after utilization in stmmac_interrupt
Date: Mon, 8 Jun 2020 19:04:09 -0400 [thread overview]
Message-ID: <20200608231211.3363633-124-sashal@kernel.org> (raw)
In-Reply-To: <20200608231211.3363633-1-sashal@kernel.org>
From: Maxim Petrov <mmrmaximuzz@gmail.com>
[ Upstream commit f42234ffd531ca6b13d9da02faa60b72eccf8334 ]
The paranoidal pointer check in IRQ handler looks very strange - it
really protects us only against bogus drivers which request IRQ line
with null pointer dev_id. However, the code fragment is incorrect
because the dev pointer is used before the actual check which leads
to undefined behavior. Remove the check to avoid confusing people
with incorrect code.
Signed-off-by: Maxim Petrov <mmrmaximuzz@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 7da18c9afa01..d564459290ce 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3988,7 +3988,7 @@ static int stmmac_set_features(struct net_device *netdev,
/**
* stmmac_interrupt - main ISR
* @irq: interrupt number.
- * @dev_id: to pass the net device pointer.
+ * @dev_id: to pass the net device pointer (must be valid).
* Description: this is the main driver interrupt service routine.
* It can call:
* o DMA service routine (to manage incoming frame reception and transmission
@@ -4012,11 +4012,6 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id)
if (priv->irq_wake)
pm_wakeup_event(priv->device, 0);
- if (unlikely(!dev)) {
- netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
- return IRQ_NONE;
- }
-
/* Check if adapter is up */
if (test_bit(STMMAC_DOWN, &priv->state))
return IRQ_HANDLED;
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-06-08 23:28 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200608231211.3363633-1-sashal@kernel.org>
2020-06-08 23:02 ` [PATCH AUTOSEL 5.6 033/606] ARM: dts: imx27-phytec-phycard-s-rdk: Fix the I2C1 pinctrl entries Sasha Levin
2020-06-08 23:02 ` [PATCH AUTOSEL 5.6 034/606] ARM: dts: imx6dl-yapp4: Fix Ursa board Ethernet connection Sasha Levin
2020-06-08 23:02 ` [PATCH AUTOSEL 5.6 045/606] clk: rockchip: fix incorrect configuration of rk3228 aclk_gpu* clocks Sasha Levin
2020-06-08 23:02 ` [PATCH AUTOSEL 5.6 048/606] arm64: dts: meson-g12b-ugoos-am6: fix usb vbus-supply Sasha Levin
2020-06-08 23:03 ` [PATCH AUTOSEL 5.6 057/606] arm64: dts: meson-g12b-khadas-vim3: add missing frddr_a status property Sasha Levin
2020-06-08 23:03 ` [PATCH AUTOSEL 5.6 059/606] arm64: dts: meson-g12-common: fix dwc2 clock names Sasha Levin
2020-06-08 23:03 ` [PATCH AUTOSEL 5.6 060/606] arm64: dts: rockchip: Replace RK805 PMIC node name with "pmic" on rk3328 boards Sasha Levin
2020-06-08 23:03 ` [PATCH AUTOSEL 5.6 061/606] arm64: dts: rockchip: Rename dwc3 device nodes on rk3399 to make dtc happy Sasha Levin
2020-06-08 23:03 ` [PATCH AUTOSEL 5.6 062/606] arm64: dts: imx8mn: Change SDMA1 ahb clock for imx8mn Sasha Levin
2020-06-08 23:04 ` Sasha Levin [this message]
2020-06-08 23:04 ` [PATCH AUTOSEL 5.6 132/606] ARM: futex: Address build warning Sasha Levin
2020-06-08 23:04 ` [PATCH AUTOSEL 5.6 141/606] bpf: Restrict bpf_probe_read{, str}() only to archs where they work Sasha Levin
2020-06-08 23:04 ` [PATCH AUTOSEL 5.6 149/606] arm64: Fix PTRACE_SYSEMU semantics Sasha Levin
2020-06-08 23:04 ` [PATCH AUTOSEL 5.6 160/606] dmaengine: owl: Use correct lock in owl_dma_get_pchan() Sasha Levin
2020-06-08 23:04 ` [PATCH AUTOSEL 5.6 173/606] iio: adc: stm32-adc: fix device used to request dma Sasha Levin
2020-06-08 23:04 ` [PATCH AUTOSEL 5.6 174/606] iio: adc: stm32-dfsdm: " Sasha Levin
2020-06-08 23:05 ` [PATCH AUTOSEL 5.6 212/606] net: dsa: mt7530: fix roaming from DSA user ports Sasha Levin
2020-06-08 23:06 ` [PATCH AUTOSEL 5.6 251/606] ARM: dts: rockchip: fix phy nodename for rk3228-evb Sasha Levin
2020-06-08 23:06 ` [PATCH AUTOSEL 5.6 252/606] ARM: dts: rockchip: fix phy nodename for rk3229-xms6 Sasha Levin
2020-06-08 23:06 ` [PATCH AUTOSEL 5.6 253/606] arm64: dts: rockchip: fix status for &gmac2phy in rk3328-evb.dts Sasha Levin
2020-06-08 23:06 ` [PATCH AUTOSEL 5.6 254/606] arm64: dts: rockchip: swap interrupts interrupt-names rk3399 gpu node Sasha Levin
2020-06-08 23:06 ` [PATCH AUTOSEL 5.6 255/606] ARM: dts: rockchip: swap clock-names of gpu nodes Sasha Levin
2020-06-08 23:06 ` [PATCH AUTOSEL 5.6 256/606] ARM: dts: rockchip: fix pinctrl sub nodename for spi in rk322x.dtsi Sasha Levin
2020-06-08 23:06 ` [PATCH AUTOSEL 5.6 282/606] drm/meson: pm resume add return errno branch Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 297/606] ARM: 8970/1: decompressor: increase tag size Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 298/606] ARM: uaccess: consolidate uaccess asm to asm/uaccess-asm.h Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 299/606] ARM: uaccess: integrate uaccess_save and uaccess_restore Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 300/606] ARM: uaccess: fix DACR mismatch with nested exceptions Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 302/606] arm64: dts: mt8173: fix vcodec-enc clock Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 303/606] soc: mediatek: cmdq: return send msg error code Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 307/606] ARM: dts/imx6q-bx50v3: Set display interface clock parents Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 308/606] ARM: dts: bcm2835-rpi-zero-w: Fix led polarity Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 309/606] ARM: dts: bcm: HR2: Fix PPI interrupt types Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 310/606] ARM: dts: mmp3: Use the MMP3 compatible string for /clocks Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 311/606] ARM: dts: mmp3-dell-ariel: Fix the SPI devices Sasha Levin
2020-06-08 23:07 ` [PATCH AUTOSEL 5.6 312/606] ARM: dts: mmp3: Drop usb-nop-xceiv from HSIC phy Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200608231211.3363633-124-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mmrmaximuzz@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).