netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC: 2.6 patch] hostap_hw.c:hfa384x_set_rid(): fix error handling
@ 2006-03-09 23:06 Adrian Bunk
  2006-03-13  1:15 ` Jouni Malinen
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2006-03-09 23:06 UTC (permalink / raw)
  To: jkmaline; +Cc: hostap, linux-kernel, netdev, linville

The Coverity checker noted that the call to prism2_hw_reset() was dead 
code.

Does this patch change the code to what was intended?


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.16-rc5-mm3-full/drivers/net/wireless/hostap/hostap_hw.c.old	2006-03-09 23:28:30.000000000 +0100
+++ linux-2.6.16-rc5-mm3-full/drivers/net/wireless/hostap/hostap_hw.c	2006-03-09 23:30:19.000000000 +0100
@@ -928,16 +928,16 @@ static int hfa384x_set_rid(struct net_de
 
 	res = hfa384x_cmd(dev, HFA384X_CMDCODE_ACCESS_WRITE, rid, NULL, NULL);
 	up(&local->rid_bap_sem);
+
 	if (res) {
+		if (res == -ETIMEDOUT)
+			prism2_hw_reset(dev);
+
 		printk(KERN_DEBUG "%s: hfa384x_set_rid: CMDCODE_ACCESS_WRITE "
 		       "failed (res=%d, rid=%04x, len=%d)\n",
 		       dev->name, res, rid, len);
-		return res;
 	}
 
-	if (res == -ETIMEDOUT)
-		prism2_hw_reset(dev);
-
 	return res;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC: 2.6 patch] hostap_hw.c:hfa384x_set_rid(): fix error handling
  2006-03-09 23:06 [RFC: 2.6 patch] hostap_hw.c:hfa384x_set_rid(): fix error handling Adrian Bunk
@ 2006-03-13  1:15 ` Jouni Malinen
  0 siblings, 0 replies; 2+ messages in thread
From: Jouni Malinen @ 2006-03-13  1:15 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: netdev, hostap, linux-kernel, linville

On Fri, Mar 10, 2006 at 12:06:46AM +0100, Adrian Bunk wrote:

> The Coverity checker noted that the call to prism2_hw_reset() was dead 
> code.
> 
> Does this patch change the code to what was intended?

Thanks! Based on my CVS history, it looks like this was broken in 2002
when the access command was moved from another function and verification
of -ETIMEDOUT value was not moved correctly. The original behavior would
be achieved by changing your patch to call printk first before the moved
prism2_hw_reset(dev) call. I added this (with the re-ordered printk) to
my queue for wireless-2.6.

-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-13  1:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-09 23:06 [RFC: 2.6 patch] hostap_hw.c:hfa384x_set_rid(): fix error handling Adrian Bunk
2006-03-13  1:15 ` Jouni Malinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).