diff options
author | Stephane Grosjean <s.grosjean@peak-system.com> | 2021-09-29 17:21:11 +0300 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-10-17 23:51:51 +0300 |
commit | 553715feaa9e0453bc59f6ba20e1c69346888bd5 (patch) | |
tree | 9a4c8c11bd195f8aea61b1efb9c7fb34a2af3eb5 /drivers/net/can | |
parent | 3d031abc7e7249573148871180c28ecedb5e27df (diff) | |
download | linux-553715feaa9e0453bc59f6ba20e1c69346888bd5.tar.xz |
can: peak_usb: pcan_usb_fd_decode_status(): remove unnecessary test on the nullity of a pointer
Since alloc_can_err_skb() puts NULL in cf in the case when skb cannot
be allocated and can_change_state() handles the case when cf is NULL,
the test on the nullity of skb is now unnecessary.
Link: https://lore.kernel.org/all/20210929142111.55757-2-s.grosjean@peak-system.com
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c index e206959b3d06..09029a3bad1a 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c @@ -567,8 +567,7 @@ static int pcan_usb_fd_decode_status(struct pcan_usb_fd_if *usb_if, /* allocate an skb to store the error frame */ skb = alloc_can_err_skb(netdev, &cf); - if (skb) - can_change_state(netdev, cf, tx_state, rx_state); + can_change_state(netdev, cf, tx_state, rx_state); /* things must be done even in case of OOM */ if (new_state == CAN_STATE_BUS_OFF) |