All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
To: Jouni Malinen <j@w1.fi>, "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org
Subject: Re: [PATCH] hostap: do not return positive number on failure path in prism2_open()
Date: Mon, 05 Aug 2013 07:18:11 +0400	[thread overview]
Message-ID: <51FF1973.7080807@ispras.ru> (raw)
In-Reply-To: <1375671750-2835-1-git-send-email-khoroshilov@ispras.ru>

Please ignore this mail, there is a misprint in signed-off line.
I will resend the patch.

On 08/05/2013 07:02 AM, Alexey Khoroshilov wrote:
> prism2_open() as an .ndo_open handler should not return positive numbers
> in case of failure, but it does return 1 in a couple of places.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilorv@ispras.ru>
> ---
>  drivers/net/wireless/hostap/hostap_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
> index 15f0fad..e4f56ad 100644
> --- a/drivers/net/wireless/hostap/hostap_main.c
> +++ b/drivers/net/wireless/hostap/hostap_main.c
> @@ -667,7 +667,7 @@ static int prism2_open(struct net_device *dev)
>  	if (local->no_pri) {
>  		printk(KERN_DEBUG "%s: could not set interface UP - no PRI "
>  		       "f/w\n", dev->name);
> -		return 1;
> +		return -ENODEV;
>  	}
>  
>  	if ((local->func->card_present && !local->func->card_present(local)) ||
> @@ -682,7 +682,7 @@ static int prism2_open(struct net_device *dev)
>  		printk(KERN_WARNING "%s: could not enable MAC port\n",
>  		       dev->name);
>  		prism2_close(dev);
> -		return 1;
> +		return -ENODEV;
>  	}
>  	if (!local->dev_enabled)
>  		prism2_callback(local, PRISM2_CALLBACK_ENABLE);


  reply	other threads:[~2013-08-05  3:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05  3:02 [PATCH] hostap: do not return positive number on failure path in prism2_open() Alexey Khoroshilov
2013-08-05  3:18 ` Alexey Khoroshilov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-08-05  3:18 Alexey Khoroshilov
2013-08-05  3:33 ` Joe Perches
2013-08-05  3:33   ` Joe Perches
2013-08-05  4:01   ` Alexey Khoroshilov
2013-08-05  4:01     ` Alexey Khoroshilov

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=51FF1973.7080807@ispras.ru \
    --to=khoroshilov@ispras.ru \
    --cc=j@w1.fi \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    /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.