ibmvnic: account for bufs already saved in indir_buf
authorSukadev Bhattiprolu <sukadev@linux.ibm.com>
Thu, 24 Jun 2021 04:13:13 +0000 (21:13 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Jun 2021 18:22:23 +0000 (11:22 -0700)
commit72368f8b2b9e4106072a2728bed3367d54641c22
treea61bffb41a241fea14fe5e4766d03334e016d1b4
parent65d6470d139a6c1655fccb5cbacbeaba8e8ad2f8
ibmvnic: account for bufs already saved in indir_buf

This fixes a crash in replenish_rx_pool() when called from ibmvnic_poll()
after a previous call to replenish_rx_pool() encountered an error when
allocating a socket buffer.

Thanks to Rick Lindsley and Dany Madden for helping debug the crash.

Fixes: 4f0b6812e9b9 ("ibmvnic: Introduce batched RX buffer descriptor transmission")
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c