diff options
author | Bert Kenward <bkenward@solarflare.com> | 2016-09-22 15:47:45 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-23 07:18:35 -0400 |
commit | 429baa6f0e1b9237a3667c3a5e8ca76051e6d0b7 (patch) | |
tree | e47aba807474005120300978b57a09b358581491 | |
parent | 88e4f75900368b8a6febb7bc7d379d52d02e920d (diff) | |
download | op-kernel-dev-429baa6f0e1b9237a3667c3a5e8ca76051e6d0b7.zip op-kernel-dev-429baa6f0e1b9237a3667c3a5e8ca76051e6d0b7.tar.gz |
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>
-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 9fbc12a..2415209 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); } |