summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorPaul Barker <paul.barker.ct@bp.renesas.com>2024-04-16 13:02:52 +0100
committerPaolo Abeni <pabeni@redhat.com>2024-04-18 11:34:28 +0200
commita892493a343494bd6bab9d098593932077ff3c43 (patch)
tree199443385a8d193f43f9b502e30ae3aa43397e6d /ipc
parentdef52db470df28d6f43cacbd21137f03b9502073 (diff)
downloadlinux-stable-a892493a343494bd6bab9d098593932077ff3c43.tar.gz
linux-stable-a892493a343494bd6bab9d098593932077ff3c43.tar.bz2
linux-stable-a892493a343494bd6bab9d098593932077ff3c43.zip
net: ravb: Allow RX loop to move past DMA mapping errors
The RX loops in ravb_rx_gbeth() and ravb_rx_rcar() skip to the next loop iteration if a zero-length descriptor is seen (indicating a DMA mapping error). However, the current RX descriptor index `priv->cur_rx[q]` was incremented at the end of the loop and so would not be incremented when we skip to the next loop iteration. This would cause the loop to keep seeing the same zero-length descriptor instead of moving on to the next descriptor. As the loop counter `i` still increments, the loop would eventually terminate so there is no risk of being stuck here forever - but we should still fix this to avoid wasting cycles. To fix this, the RX descriptor index is incremented at the top of the loop, in the for statement itself. The assignments of `entry` and `desc` are brought into the loop to avoid the need for duplication. Fixes: d8b48911fd24 ("ravb: fix ring memory allocation") Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions