linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/13] staging: wilc1000: wilc_frmw_to_linux(): fixes null check
@ 2016-01-27  2:50 Glen Lee
  2016-01-27  2:50 ` [PATCH 02/13] staging: wilc1000: fixes no space is necessary after a cast Glen Lee
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Glen Lee @ 2016-01-27  2:50 UTC (permalink / raw)
  To: gregkh
  Cc: devel, linux-wireless, tony.cho, glen.lee, leo.kim, austin.shin,
	Chris.Park, adham.abozaeid, Nicolas.FERRE

From: Leo Kim <leo.kim@atmel.com>

Null checking wilc_netdev and skb->dev are already done in the begining of the
function and they are just print printing error log, so delete them.
Null checking wilc is needed before is used so add null ckeck before it is
used.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Glen Lee <glen.lee@atmel.com>
---
 drivers/staging/wilc1000/linux_wlan.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index ee779ee..db91a21 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1342,6 +1342,9 @@ void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
 	struct net_device *wilc_netdev;
 	struct wilc_vif *vif;
 
+	if (!wilc)
+		return;
+
 	wilc_netdev = get_if_handler(wilc, buff);
 	if (!wilc_netdev)
 		return;
@@ -1358,14 +1361,8 @@ void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
 			PRINT_ER("Low memory - packet droped\n");
 			return;
 		}
-
-		if (!wilc || !wilc_netdev)
-			PRINT_ER("wilc_netdev in wilc is NULL");
 		skb->dev = wilc_netdev;
 
-		if (!skb->dev)
-			PRINT_ER("skb->dev is NULL\n");
-
 		memcpy(skb_put(skb, frame_len), buff_to_send, frame_len);
 
 		skb->protocol = eth_type_trans(skb, wilc_netdev);
-- 
1.9.1


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

end of thread, other threads:[~2016-02-03 23:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-27  2:50 [PATCH 01/13] staging: wilc1000: wilc_frmw_to_linux(): fixes null check Glen Lee
2016-01-27  2:50 ` [PATCH 02/13] staging: wilc1000: fixes no space is necessary after a cast Glen Lee
2016-01-27  2:50 ` [PATCH 03/13] staging: wilc1000: fixes add spaces required around Glen Lee
2016-01-27  2:50 ` [PATCH 04/13] staging: wilc1000: rename hWILCWFIDrv of wilc_priv structure Glen Lee
2016-02-03 23:28   ` Greg KH
2016-01-27  2:50 ` [PATCH 05/13] staging: wilc1000: rename Firmware_ver variable Glen Lee
2016-01-27  2:50 ` [PATCH 06/13] staging: wilc1000: fixes missing a blank line after declarations Glen Lee
2016-01-27  2:50 ` [PATCH 07/13] staging: wilc1000: rename pBssid of tx_complete_data structure Glen Lee
2016-01-27  2:50 ` [PATCH 08/13] staging: wilc1000: remove warnings line over 80 characters Glen Lee
2016-01-27  2:50 ` [PATCH 09/13] staging: wilc1000: removes unnecessary debug logs Glen Lee
2016-01-27  2:50 ` [PATCH 11/13] staging: wilc1000: removes void function return Glen Lee
2016-01-27  2:50 ` [PATCH 12/13] staging: wilc1000: renames u8IfIdx of wilc_vif structure Glen Lee
2016-01-27  2:50 ` [PATCH 13/13] staging: wilc1000: fixes variable dereferenced before check Glen Lee

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).