Search Linux Wireless

Re: [PATCH] mac80211: station state transition error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 4, 2012 at 12:28 PM, Johannes Berg
<johannes@xxxxxxxxxxxxxxxx> wrote:
> From: Johannes Berg <johannes.berg@xxxxxxxxx>
>
> In the future, when we start notifying drivers,
> state transitions could potentially fail. To make
> it easier to distinguish between programming bugs
> and driver failures:
>  * rename sta_info_move_state() to
>   sta_info_pre_move_state() which can only be
>   called before the station is inserted (and
>   check this with a new station flag).
>  * rename sta_info_move_state_checked() to just
>   plain sta_info_move_state(), as it will be
>   the regular function that can fail for more
>   than just one reason (bad transition or an
>   error from the driver)
>
> This makes the programming model easier -- one of
> the functions can only be called before insertion
> and can't fail, the other can fail.
>
> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
> ---
[...]

> +       if (err) {
> +               printk(KERN_DEBUG
> +                      "%s: failed to move station %pM to desired state\n",
> +                      sdata->name, sta->sta.addr);
> +               sta_info_destroy_addr(sdata, sta->sta.addr);
> +               mutex_unlock(&sdata->local->sta_mtx);
> +               return false;
> +       }
>
sta_info_destroy_addr takes the mutex by itself, so i guess you should
either release it before or call __sta_info_destroy directly?

Eliad.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux