Skip to content

Commit 429baa6

Browse files
sf-hgkdavem330
authored andcommitted
sfc: check async completer is !NULL before calling
Add a NULL check before calling asynchronous MCDI completion functions during device removal. Fixes: 7014d7f ("sfc: allow asynchronous MCDI without completion function") Signed-off-by: Bert Kenward <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 88e4f75 commit 429baa6

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/sfc

1 file changed

+2
-1
lines changed

drivers/net/ethernet/sfc/mcdi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,8 @@ void efx_mcdi_flush_async(struct efx_nic *efx)
11561156
* acquired locks in the wrong order.
11571157
*/
11581158
list_for_each_entry_safe(async, next, &mcdi->async_list, list) {
1159-
async->complete(efx, async->cookie, -ENETDOWN, NULL, 0);
1159+
if (async->complete)
1160+
async->complete(efx, async->cookie, -ENETDOWN, NULL, 0);
11601161
list_del(&async->list);
11611162
kfree(async);
11621163
}

0 commit comments

Comments
 (0)