提交 0953a2e3 编写于 作者: L Leo Kim 提交者: Greg Kroah-Hartman

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: NLeo Kim <leo.kim@atmel.com>
Signed-off-by: NGlen Lee <glen.lee@atmel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 4cf93d70
...@@ -1322,6 +1322,9 @@ void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset) ...@@ -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 net_device *wilc_netdev;
struct wilc_vif *vif; struct wilc_vif *vif;
if (!wilc)
return;
wilc_netdev = get_if_handler(wilc, buff); wilc_netdev = get_if_handler(wilc, buff);
if (!wilc_netdev) if (!wilc_netdev)
return; return;
...@@ -1338,14 +1341,8 @@ void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset) ...@@ -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"); PRINT_ER("Low memory - packet droped\n");
return; return;
} }
if (!wilc || !wilc_netdev)
PRINT_ER("wilc_netdev in wilc is NULL");
skb->dev = wilc_netdev; 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); memcpy(skb_put(skb, frame_len), buff_to_send, frame_len);
skb->protocol = eth_type_trans(skb, wilc_netdev); skb->protocol = eth_type_trans(skb, wilc_netdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册