Thread (1 message) 1 message, 1 author, 2015-06-10

Re: [PATCH] iwlwifi:dvm:Return false if resume command data is not same size as received packet for the function iwl_resume_status_fn

From: Grumbach, Emmanuel <hidden>
Date: 2015-06-10 17:10:23
Also in: linux-wireless, lkml

On Wed, 2015-06-10 at 12:58 -0400, Nicholas Krause wrote:
On June 10, 2015 12:50:45 PM EDT, "Grumbach, Emmanuel" [off-list ref] wrote:
quoted
On Wed, 2015-06-10 at 12:33 -0400, Nicholas Krause wrote:
quoted
This makes the function iwl_resume_status_fn return false now if
the received packet of type iwl_rx_packet is not the same size
as the structure pointer, iwl_resume_data's cmd element in order
to signal callers about this error and allow them to handle it
occurrently.
Hm... Did you actually hit this if?
I am not sure I really want to wait here (which is what will happen if
you return false) when we get an unexpected length? I do not expect
anything besides the response I am waiting for since the firmware is
handling the GET_STATUS *only* - it just came back from WoWLAN. Bottom
line, this is really an error path and I prefer to exit and not wait
for
the timeout in that case.
But I might be missing something?
Why not wait for the time out?  Seems there is no reason not to and in that case
if the firmware handles this
I doubt it will. This goes back to my original question: did you really
hit this path? Does the patch solves a real bug you faced?
why is the if statement still here. 
To get a debug print? :)
Nick 
quoted
quoted
Signed-off-by: Nicholas Krause <redacted>
---
 drivers/net/wireless/iwlwifi/dvm/mac80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
quoted
index 5abd62e..21e808c 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -409,7 +409,7 @@ static bool iwl_resume_status_fn(struct
iwl_notif_wait_data *notif_wait,
quoted
 
 	if (iwl_rx_packet_payload_len(pkt) != sizeof(*resume_data->cmd)) {
 		IWL_ERR(priv, "rx wrong size data\n");
-		return true;
+		return false;
 	}
 	memcpy(resume_data->cmd, pkt->data, sizeof(*resume_data->cmd));
 	resume_data->valid = true;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help