From: Bert Kenward Date: Thu, 11 Aug 2016 12:01:21 +0000 (+0100) Subject: sfc: allow asynchronous MCDI without completion function X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7014d7f672f7dc180d1386239c4f0c455e405ed9;p=openwrt%2Fstaging%2Fblogic.git sfc: allow asynchronous MCDI without completion function Signed-off-by: Bert Kenward Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index d28e7dd8fa3c..9fbc12a8f80c 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c @@ -548,7 +548,10 @@ static bool efx_mcdi_complete_async(struct efx_mcdi_iface *mcdi, bool timeout) efx_mcdi_display_error(efx, async->cmd, async->inlen, errbuf, err_len, rc); } - async->complete(efx, async->cookie, rc, outbuf, data_len); + + if (async->complete) + async->complete(efx, async->cookie, rc, outbuf, + min(async->outlen, data_len)); kfree(async); efx_mcdi_release(mcdi);