Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> --- net/can/j1939/transport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c index ca2571bed0de..efaa7c7a10d2 100644 --- a/net/can/j1939/transport.c +++ b/net/can/j1939/transport.c @@ -1352,6 +1352,9 @@ j1939_session *j1939_xtp_rx_rts_session_new(struct j1939_priv *priv, pgn = j1939_xtp_ctl_to_pgn(dat); skcb.addr.pgn = pgn; + if (!j1939_sk_recv_match(priv, &skcb)) + return NULL; + if (skcb.addr.type == J1939_ETP) { len = j1939_etp_ctl_to_size(dat); if (len > J1939_MAX_ETP_PACKET_SIZE) @@ -1373,9 +1376,6 @@ j1939_session *j1939_xtp_rx_rts_session_new(struct j1939_priv *priv, return NULL; } - if (!j1939_sk_recv_match(priv, &skcb)) - return NULL; - session = j1939_session_fresh_new(priv, len, &skcb); if (!session) { j1939_xtp_tx_abort(priv, &skcb, true, -- 2.20.1