mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 12:25:18 +02:00
mISDN: Fix a use after free in hfcmulti_tx()
[ Upstream commit61ab751451
] Don't dereference *sp after calling dev_kfree_skb(*sp). Fixes:af69fb3a8f
("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>
This commit is contained in:
parent
c3496314c5
commit
ddc7955664
|
@ -1900,7 +1900,7 @@ hfcmulti_dtmf(struct hfc_multi *hc)
|
||||||
static void
|
static void
|
||||||
hfcmulti_tx(struct hfc_multi *hc, int ch)
|
hfcmulti_tx(struct hfc_multi *hc, int ch)
|
||||||
{
|
{
|
||||||
int i, ii, temp, len = 0;
|
int i, ii, temp, tmp_len, len = 0;
|
||||||
int Zspace, z1, z2; /* must be int for calculation */
|
int Zspace, z1, z2; /* must be int for calculation */
|
||||||
int Fspace, f1, f2;
|
int Fspace, f1, f2;
|
||||||
u_char *d;
|
u_char *d;
|
||||||
|
@ -2121,14 +2121,15 @@ next_frame:
|
||||||
HFC_wait_nodebug(hc);
|
HFC_wait_nodebug(hc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmp_len = (*sp)->len;
|
||||||
dev_kfree_skb(*sp);
|
dev_kfree_skb(*sp);
|
||||||
/* check for next frame */
|
/* check for next frame */
|
||||||
if (bch && get_next_bframe(bch)) {
|
if (bch && get_next_bframe(bch)) {
|
||||||
len = (*sp)->len;
|
len = tmp_len;
|
||||||
goto next_frame;
|
goto next_frame;
|
||||||
}
|
}
|
||||||
if (dch && get_next_dframe(dch)) {
|
if (dch && get_next_dframe(dch)) {
|
||||||
len = (*sp)->len;
|
len = tmp_len;
|
||||||
goto next_frame;
|
goto next_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user