Skip to content

Commit 7e4a539

Browse files
Dan Carpentergregkh
authored andcommitted
mISDN: Fix a use after free in hfcmulti_tx()
[ Upstream commit 61ab751 ] Don't dereference *sp after calling dev_kfree_skb(*sp). Fixes: af69fb3 ("Add mISDN HFC multiport driver") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/8be65f5a-c2dd-4ba0-8a10-bfe5980b8cfb@stanley.mountain Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 35dd375 commit 7e4a539

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/isdn/hardware/mISDN/hfcmulti.c

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

2124+
tmp_len = (*sp)->len;
21242125
dev_kfree_skb(*sp);
21252126
/* check for next frame */
21262127
if (bch && get_next_bframe(bch)) {
2127-
len = (*sp)->len;
2128+
len = tmp_len;
21282129
goto next_frame;
21292130
}
21302131
if (dch && get_next_dframe(dch)) {
2131-
len = (*sp)->len;
2132+
len = tmp_len;
21322133
goto next_frame;
21332134
}
21342135

0 commit comments

Comments
 (0)