diff options
author | Bert Kenward <bkenward@solarflare.com> | 2016-09-22 16:47:45 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-23 13:18:35 +0200 |
commit | 429baa6f0e1b9237a3667c3a5e8ca76051e6d0b7 (patch) | |
tree | e47aba807474005120300978b57a09b358581491 /drivers/net/ethernet/sfc/mcdi.c | |
parent | Merge branch 'sctp-fix-gap-ack-blocks' (diff) | |
download | linux-429baa6f0e1b9237a3667c3a5e8ca76051e6d0b7.tar.xz linux-429baa6f0e1b9237a3667c3a5e8ca76051e6d0b7.zip |
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/net/ethernet/sfc/mcdi.c')
-rw-r--r-- | drivers/net/ethernet/sfc/mcdi.c | 3 |
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); } |