[PATCH] wifi: mt76: mt7915: Fix an error handling path in mt7915_add_interface()

Markus Elfring Markus.Elfring at web.de
Tue Oct 1 12:08:12 PDT 2024


> If mt76_wcid_alloc() fails, the "mt76.mutex" mutex needs to be released as
> done in the other error handling path of mt7915_add_interface().

                                   paths?


…
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
> @@ -246,8 +246,10 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
>  	phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx);
>
>  	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, mt7915_wtbl_size(dev));
> -	if (idx < 0)
> -		return -ENOSPC;
> +	if (idx < 0) {
> +		ret = -ENOSPC;
> +		goto out;
> +	}
…

Would you dare to support another jump target for this assignment statement?

Regards,
Markus



More information about the Linux-mediatek mailing list