Skip to content

Commit a08ec5f

Browse files
can: j1939: j1939_xtp_rx_dat_one(): use separate pointer for session skb control buffer
In the j1939_xtp_rx_dat_one() function, there are 2 variables (skb and se_skb) holding a skb. The control buffer of the skbs is accessed one after the other, but using the same "skcb" variable. To avoid confusion introduce a new variable "se_skcb" to access the se_skb's control buffer as done in the rest of this file, too. Cc: Robin van der Gracht <[email protected]> Cc: Oleksij Rempel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 78b77c7 commit a08ec5f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/can/j1939/transport.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ static void j1939_xtp_rx_dat_one(struct j1939_session *session,
17711771
struct sk_buff *skb)
17721772
{
17731773
struct j1939_priv *priv = session->priv;
1774-
struct j1939_sk_buff_cb *skcb;
1774+
struct j1939_sk_buff_cb *skcb, *se_skcb;
17751775
struct sk_buff *se_skb = NULL;
17761776
const u8 *dat;
17771777
u8 *tpdat;
@@ -1822,8 +1822,8 @@ static void j1939_xtp_rx_dat_one(struct j1939_session *session,
18221822
goto out_session_cancel;
18231823
}
18241824

1825-
skcb = j1939_skb_to_cb(se_skb);
1826-
offset = packet * 7 - skcb->offset;
1825+
se_skcb = j1939_skb_to_cb(se_skb);
1826+
offset = packet * 7 - se_skcb->offset;
18271827
nbytes = se_skb->len - offset;
18281828
if (nbytes > 7)
18291829
nbytes = 7;
@@ -1851,7 +1851,7 @@ static void j1939_xtp_rx_dat_one(struct j1939_session *session,
18511851
if (packet == session->pkt.rx)
18521852
session->pkt.rx++;
18531853

1854-
if (skcb->addr.type != J1939_ETP &&
1854+
if (se_skcb->addr.type != J1939_ETP &&
18551855
j1939_cb_is_broadcast(&session->skcb)) {
18561856
if (session->pkt.rx >= session->pkt.total)
18571857
final = true;

0 commit comments

Comments
 (0)