All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Ganapathi Bhat <gbhat@marvell.com>
Cc: linux-wireless@vger.kernel.org, Cathy Luo <cluo@marvell.com>,
	Xinming Hu <huxm@marvell.com>, Zhiyuan Yang <yangzy@marvell.com>,
	James Cao <jcao@marvell.com>,
	Mangesh Malusare <mmangesh@marvell.com>
Subject: Re: [PATCH] mwifiex: check for mfg_mode in add_virtual_intf
Date: Thu, 31 Aug 2017 13:21:47 -0700	[thread overview]
Message-ID: <20170831202146.GA27509@google.com> (raw)
In-Reply-To: <1504118818-1749-1-git-send-email-gbhat@marvell.com>

On Thu, Aug 31, 2017 at 12:16:58AM +0530, Ganapathi Bhat wrote:
> If driver is loaded with 'mfg_mode' enabled, then the sending
> commands are not allowed. So, when mwifiex_send_cmd fails in
> mwifiex_add_virtual_intf, driver must check for 'mfg_mode' before
> returning error.
> 
> Fixes: 7311ea850079 ("mwifiex: fix AP start problem for newly added interface")
> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
> ---
>  drivers/net/wireless/marvell/mwifiex/cfg80211.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> index ffada17..1856205 100644
> --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
> @@ -2967,11 +2967,11 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
>  
>  	ret = mwifiex_send_cmd(priv, HostCmd_CMD_SET_BSS_MODE,
>  			       HostCmd_ACT_GEN_SET, 0, NULL, true);
> -	if (ret)
> +	if (ret && !adapter->mfg_mode)

It doesn't feel like ignoring errors is the best approach here,
especially when it's only a single command that we could easily just
skip.

So, why don't you just skip it, like this?

	if (!adapter->mfg_mode) {
		ret = mwifiex_send_cmd(...);
		if (ret)
			goto err_set_bss_mode;
	}

>  		goto err_set_bss_mode;
>  
>  	ret = mwifiex_sta_init_cmd(priv, false, false);
> -	if (ret)
> +	if (ret && !adapter->mfg_mode)
>  		goto err_sta_init;

Same here; I think it's safe to just completely skip
mwifiex_sta_init_cmd(), no?

Brian

>  
>  	mwifiex_setup_ht_caps(&wiphy->bands[NL80211_BAND_2GHZ]->ht_cap, priv);
> -- 
> 1.9.1
> 

  reply	other threads:[~2017-08-31 20:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 18:46 [PATCH] mwifiex: check for mfg_mode in add_virtual_intf Ganapathi Bhat
2017-08-31 20:21 ` Brian Norris [this message]
2017-09-07 20:41   ` [EXT] " Ganapathi Bhat
  -- strict thread matches above, loose matches on Subject: below --
2017-09-07 20:32 Ganapathi Bhat
2017-09-08 19:42 ` Brian Norris
2017-09-12  6:03   ` Kalle Valo

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=20170831202146.GA27509@google.com \
    --to=briannorris@chromium.org \
    --cc=cluo@marvell.com \
    --cc=gbhat@marvell.com \
    --cc=huxm@marvell.com \
    --cc=jcao@marvell.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mmangesh@marvell.com \
    --cc=yangzy@marvell.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.