[PATCH v1 08/34] j1939: bus: add sanity check in j1939_name_to_addr()

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

 



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

diff --git a/net/can/j1939/bus.c b/net/can/j1939/bus.c
index d106e2d333a2..9a290c906869 100644
--- a/net/can/j1939/bus.c
+++ b/net/can/j1939/bus.c
@@ -255,7 +255,7 @@ u8 j1939_name_to_addr(struct j1939_priv *priv, name_t name)
 
 	read_lock_bh(&priv->lock);
 	ecu = j1939_ecu_find_by_name_locked(priv, name);
-	if (j1939_ecu_is_mapped_locked(ecu))
+	if (ecu && j1939_ecu_is_mapped_locked(ecu))
 		/* ecu's SA is registered */
 		addr = ecu->addr;
 
-- 
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