Skip to content

Commit 3b557be

Browse files
Jinjie Ruankuba-moo
authored andcommitted
net: wwan: t7xx: Fix off-by-one error in t7xx_dpmaif_rx_buf_alloc()
The error path in t7xx_dpmaif_rx_buf_alloc(), free and unmap the already allocated and mapped skb in a loop, but the loop condition terminates when the index reaches zero, which fails to free the first allocated skb at index zero. Check with i-- so that skb at index 0 is freed as well. Cc: [email protected] Fixes: d642b01 ("net: wwan: t7xx: Add data path interface") Acked-by: Sergey Ryazanov <[email protected]> Signed-off-by: Jinjie Ruan <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b218318 commit 3b557be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ int t7xx_dpmaif_rx_buf_alloc(struct dpmaif_ctrl *dpmaif_ctrl,
226226
return 0;
227227

228228
err_unmap_skbs:
229-
while (--i > 0)
229+
while (i--)
230230
t7xx_unmap_bat_skb(dpmaif_ctrl->dev, bat_req->bat_skb, i);
231231

232232
return ret;

0 commit comments

Comments
 (0)