summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBert Kenward <bkenward@solarflare.com>2016-09-22 15:47:45 +0100
committerDavid S. Miller <davem@davemloft.net>2016-09-23 07:18:35 -0400
commit429baa6f0e1b9237a3667c3a5e8ca76051e6d0b7 (patch)
treee47aba807474005120300978b57a09b358581491 /drivers
parent88e4f75900368b8a6febb7bc7d379d52d02e920d (diff)
downloadlinux-429baa6f0e1b9237a3667c3a5e8ca76051e6d0b7.tar.bz2
sfc: check async completer is !NULL before calling
Add a NULL check before calling asynchronous MCDI completion functions during device removal. Fixes: 7014d7f6 ("sfc: allow asynchronous MCDI without completion function") Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/sfc/mcdi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index 9fbc12a8f80c..241520943ada 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -1156,7 +1156,8 @@ void efx_mcdi_flush_async(struct efx_nic *efx)
* acquired locks in the wrong order.
*/
list_for_each_entry_safe(async, next, &mcdi->async_list, list) {
- async->complete(efx, async->cookie, -ENETDOWN, NULL, 0);
+ if (async->complete)
+ async->complete(efx, async->cookie, -ENETDOWN, NULL, 0);
list_del(&async->list);
kfree(async);
}