All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Eliad Peller <eliad@wizery.com>
Subject: Re: [PATCH] mac80211: clean up an ieee80211_do_open error path
Date: Tue, 03 Apr 2012 14:48:29 +0200	[thread overview]
Message-ID: <1333457309.3574.20.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1333457154.3574.18.camel@jlt3.sipsolutions.net> (sfid-20120403_144559_919415_04C97E86)

On Tue, 2012-04-03 at 14:45 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Eliad's comment prompted me to look closer at
> the error paths in ieee80211_do_open() and I
> found one that should use the error labels.

Note that in practice it doesn't matter.

> +++ b/net/mac80211/iface.c	2012-04-03 14:44:24.000000000 +0200
> @@ -349,9 +349,8 @@ static int ieee80211_do_open(struct net_
>  		memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN);
>  
>  		if (!is_valid_ether_addr(dev->dev_addr)) {
> -			if (!local->open_count)
> -				drv_stop(local);
> -			return -EADDRNOTAVAIL;
> +			res = -EADDRNOTAVAIL;
> +			goto err_stop;
>  		}

This calls drv_stop() etc, so the only thing we don't clean up here is

>  	sdata->bss = NULL;
>  	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
>  		list_del(&sdata->u.vlan.list);
> +	/* might already be clear but that doesn't matter */
>  	clear_bit(SDATA_STATE_RUNNING, &sdata->state);

the BSS clearing and the state bit. Neither of those can actually be
relevant though since AP_VLAN interfaces can't be brought up as the
first ones since they're slaved to an AP interface...

Still better to clean up, but no reason to bother stable.

johannes


      reply	other threads:[~2012-04-03 12:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-03 12:45 [PATCH] mac80211: clean up an ieee80211_do_open error path Johannes Berg
2012-04-03 12:48 ` Johannes Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333457309.3574.20.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=eliad@wizery.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.