diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index fc5725f6daee..c0235c3cb028 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -3799,8 +3799,8 @@ static int hwsim_cloned_frame_received_nl(struct sk_buff *skb_2, const u8 *dst; int frame_data_len; void *frame_data; - struct sk_buff *skb = NULL; - struct ieee80211_channel *channel = NULL; + struct sk_buff *skb; + struct ieee80211_channel *channel; if (!info->attrs[HWSIM_ATTR_ADDR_RECEIVER] || !info->attrs[HWSIM_ATTR_FRAME] || @@ -3814,7 +3814,7 @@ static int hwsim_cloned_frame_received_nl(struct sk_buff *skb_2, /* Allocate new skb here */ skb = alloc_skb(frame_data_len, GFP_KERNEL); - if (skb == NULL) + if (!skb) goto err; if (frame_data_len > IEEE80211_MAX_DATA_LEN) @@ -3875,7 +3875,7 @@ static int hwsim_cloned_frame_received_nl(struct sk_buff *skb_2, rx_status.rate_idx = nla_get_u32(info->attrs[HWSIM_ATTR_RX_RATE]); rx_status.signal = nla_get_u32(info->attrs[HWSIM_ATTR_SIGNAL]); - hdr = (void *)skb->data; + hdr = (struct ieee80211_hdr *)skb->data; if (ieee80211_is_beacon(hdr->frame_control) || ieee80211_is_probe_resp(hdr->frame_control))