Thread (3 messages) 3 messages, 2 authors, 2021-10-17

[PATCH 2/2] can: peak_usb: removes unnecessary test on the nullity of a pointer

flat view
STALE1820d LANDED

From: Stephane Grosjean <hidden>
Date: 2021-09-29 14:22:05
Subsystem: can network drivers, the rest · Maintainers: Marc Kleine-Budde, Vincent Mailhol, Linus Torvalds

Landed in mainline as 553715feaa9e on 2021-10-17.

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.

Signed-off-by: Stephane Grosjean <redacted>
---
 drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 3 +--
 1 file changed, 1 insertion(+), 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)
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help