diff mbox series

[21/30] sfc: Add missing annotation for efx_ef10_try_update_nic_stats_vf()

Message ID 20200214204741.94112-22-jbi.octave@gmail.com
State Not Applicable
Delegated to: David Miller
Headers show
Series None | expand

Commit Message

Jules Irenge Feb. 14, 2020, 8:47 p.m. UTC
Sparse reports a warning at  efx_ef10_try_update_nic_stats_vf()

warning: context imbalance in  efx_ef10_try_update_nic_stats_vf()
	 - unexpected unlock

The root cause is the missing annotation at
efx_ef10_try_update_nic_stats_vf()
Add the missing __must_hold(&efx->stats_lock) annotattion

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/net/ethernet/sfc/ef10.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Martin Habets Feb. 17, 2020, 6 p.m. UTC | #1
On 14/02/2020 20:47, Jules Irenge wrote:
> Sparse reports a warning at  efx_ef10_try_update_nic_stats_vf()
> 
> warning: context imbalance in  efx_ef10_try_update_nic_stats_vf()
> 	 - unexpected unlock
> 
> The root cause is the missing annotation at
> efx_ef10_try_update_nic_stats_vf()
> Add the missing __must_hold(&efx->stats_lock) annotattion
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Thanks

Acked-by: Martin Habets <mhabets@solarflare.com>

> ---
>  drivers/net/ethernet/sfc/ef10.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
> index 52113b7529d6..b1102c7e814d 100644
> --- a/drivers/net/ethernet/sfc/ef10.c
> +++ b/drivers/net/ethernet/sfc/ef10.c
> @@ -1820,6 +1820,7 @@ static size_t efx_ef10_update_stats_pf(struct efx_nic *efx, u64 *full_stats,
>  }
>  
>  static int efx_ef10_try_update_nic_stats_vf(struct efx_nic *efx)
> +	__must_hold(&efx->stats_lock)
>  {
>  	MCDI_DECLARE_BUF(inbuf, MC_CMD_MAC_STATS_IN_LEN);
>  	struct efx_ef10_nic_data *nic_data = efx->nic_data;
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 52113b7529d6..b1102c7e814d 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -1820,6 +1820,7 @@  static size_t efx_ef10_update_stats_pf(struct efx_nic *efx, u64 *full_stats,
 }
 
 static int efx_ef10_try_update_nic_stats_vf(struct efx_nic *efx)
+	__must_hold(&efx->stats_lock)
 {
 	MCDI_DECLARE_BUF(inbuf, MC_CMD_MAC_STATS_IN_LEN);
 	struct efx_ef10_nic_data *nic_data = efx->nic_data;