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

From: Markus Elfring
Date: Tue Oct 01 2024 - 15:09:08 EST


> 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