]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
can: kvaser_pciefd: Skip redundant NULL pointer check in ISR
authorMartin Jocic <martin.jocic@kvaser.com>
Fri, 14 Jun 2024 15:15:19 +0000 (17:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:11:32 +0000 (11:11 +0200)
[ Upstream commit ac765219c2c4e44f29063724c8d36435a3e61985 ]

This check is already done at the creation of the net devices in
kvaser_pciefd_setup_can_ctrls called from kvaser_pciefd_probe.

If it fails, the driver won't load, so there should be no need to
repeat the check inside the ISR. The number of channels is read
from the FPGA and should be trusted.

Signed-off-by: Martin Jocic <martin.jocic@kvaser.com>
Link: https://lore.kernel.org/all/20240614151524.2718287-3-martin.jocic@kvaser.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Stable-dep-of: dd885d90c047 ("can: kvaser_pciefd: Use a single write when releasing RX buffers")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/kvaser_pciefd.c

index a57005faa04f51228a4cac15191bd1d7b53030c5..076fc2f5b34bba7c893e204fcbf32a88bc6cbbee 100644 (file)
@@ -1641,12 +1641,6 @@ static irqreturn_t kvaser_pciefd_irq_handler(int irq, void *dev)
                kvaser_pciefd_receive_irq(pcie);
 
        for (i = 0; i < pcie->nr_channels; i++) {
-               if (!pcie->can[i]) {
-                       dev_err(&pcie->pci->dev,
-                               "IRQ mask points to unallocated controller\n");
-                       break;
-               }
-
                /* Check that mask matches channel (i) IRQ mask */
                if (board_irq & irq_mask->kcan_tx[i])
                        kvaser_pciefd_transmit_irq(pcie->can[i]);