Skip to content

Commit 61ab751

Browse files
Dan Carpenterkuba-moo
authored andcommitted
mISDN: Fix a use after free in hfcmulti_tx()
Don't dereference *sp after calling dev_kfree_skb(*sp). Fixes: af69fb3 ("Add mISDN HFC multiport driver") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 36e3b94 commit 61ab751

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/isdn/hardware/mISDN/hfcmulti.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ hfcmulti_dtmf(struct hfc_multi *hc)
19011901
static void
19021902
hfcmulti_tx(struct hfc_multi *hc, int ch)
19031903
{
1904-
int i, ii, temp, len = 0;
1904+
int i, ii, temp, tmp_len, len = 0;
19051905
int Zspace, z1, z2; /* must be int for calculation */
19061906
int Fspace, f1, f2;
19071907
u_char *d;
@@ -2122,14 +2122,15 @@ hfcmulti_tx(struct hfc_multi *hc, int ch)
21222122
HFC_wait_nodebug(hc);
21232123
}
21242124

2125+
tmp_len = (*sp)->len;
21252126
dev_kfree_skb(*sp);
21262127
/* check for next frame */
21272128
if (bch && get_next_bframe(bch)) {
2128-
len = (*sp)->len;
2129+
len = tmp_len;
21292130
goto next_frame;
21302131
}
21312132
if (dch && get_next_dframe(dch)) {
2132-
len = (*sp)->len;
2133+
len = tmp_len;
21332134
goto next_frame;
21342135
}
21352136

0 commit comments

Comments
 (0)