[PATCH v1 2/6] j1939: j1939_can_recv: add sanity test on skb_clone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don't the kernel to explode on error case.

Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
 net/can/j1939/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/can/j1939/main.c b/net/can/j1939/main.c
index 04e4574478e5..639aeb33c19a 100644
--- a/net/can/j1939/main.c
+++ b/net/can/j1939/main.c
@@ -42,6 +42,8 @@ static void j1939_can_recv(struct sk_buff *iskb, void *data)
 	 * j1939 may not touch the incoming skb in such way
 	 */
 	skb = skb_clone(iskb, GFP_ATOMIC);
+	if (!skb)
+		return;
 
 	/* get a pointer to the header of the skb
 	 * the skb payload (pointer) is moved, so that the next skb_data
-- 
2.20.1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux