summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Kim <leo.kim@atmel.com>2016-01-27 05:50:25 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-04 02:28:21 +0300
commit0953a2e33b0fca7db82081f85eb7ed6b4b76a669 (patch)
treea0a13a79b9e55de9ab91cea261af004f0b91f7ab
parent4cf93d706fb9178cd9c8366c958b52a4ebca41f0 (diff)
downloadlinux-0953a2e33b0fca7db82081f85eb7ed6b4b76a669.tar.xz
staging: wilc1000: wilc_frmw_to_linux(): fixes null check
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/wilc1000/linux_wlan.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 2489ea30855c..505b1233386c 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1322,6 +1322,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;
@@ -1338,14 +1341,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);