]> git.baikalelectronics.ru Git - kernel.git/commit
sfc: pass valid pointers from efx_enqueue_unwind
authorBert Kenward <bkenward@solarflare.com>
Thu, 7 Dec 2017 17:18:58 +0000 (17:18 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Dec 2017 18:25:39 +0000 (13:25 -0500)
commitbe5295f1e5196c9f07639dc5cea4c890d26a8414
treeba5facbcc8cbb76b382a6b607f91ce050e42d552
parent44f6f12b54c8979f0538c65949c54e8fad90b8e7
sfc: pass valid pointers from efx_enqueue_unwind

The bytes_compl and pkts_compl pointers passed to efx_dequeue_buffers
cannot be NULL. Add a paranoid warning to check this condition and fix
the one case where they were NULL.

efx_enqueue_unwind() is called very rarely, during error handling.
Without this fix it would fail with a NULL pointer dereference in
efx_dequeue_buffer, with efx_enqueue_skb in the call stack.

Fixes: b3818c9f8958 ("sfc: Firmware-Assisted TSO version 2")
Reported-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Tested-by: Jarod Wilson <jarod@redhat.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/tx.c