diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2013-08-04 23:18:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-08-05 14:52:45 -0400 |
commit | 0cbe8c87fe02513e6de981c18502d220ed4afe41 (patch) | |
tree | b08bf57dfed97c33044c34a2ece0c36d3fc6aa6e /drivers/net | |
parent | 84893817aa382b923e3d7491e7081eeb6d9ec213 (diff) |
hostap: do not return positive number on failure path in prism2_open()
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 <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 15f0fad39add..e4f56ad26cd8 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) | |||
667 | if (local->no_pri) { | 667 | if (local->no_pri) { |
668 | printk(KERN_DEBUG "%s: could not set interface UP - no PRI " | 668 | printk(KERN_DEBUG "%s: could not set interface UP - no PRI " |
669 | "f/w\n", dev->name); | 669 | "f/w\n", dev->name); |
670 | return 1; | 670 | return -ENODEV; |
671 | } | 671 | } |
672 | 672 | ||
673 | if ((local->func->card_present && !local->func->card_present(local)) || | 673 | if ((local->func->card_present && !local->func->card_present(local)) || |
@@ -682,7 +682,7 @@ static int prism2_open(struct net_device *dev) | |||
682 | printk(KERN_WARNING "%s: could not enable MAC port\n", | 682 | printk(KERN_WARNING "%s: could not enable MAC port\n", |
683 | dev->name); | 683 | dev->name); |
684 | prism2_close(dev); | 684 | prism2_close(dev); |
685 | return 1; | 685 | return -ENODEV; |
686 | } | 686 | } |
687 | if (!local->dev_enabled) | 687 | if (!local->dev_enabled) |
688 | prism2_callback(local, PRISM2_CALLBACK_ENABLE); | 688 | prism2_callback(local, PRISM2_CALLBACK_ENABLE); |