[SK_BUFF]: Introduce skb_reset_mac_header(skb)
[powerpc.git] / drivers / net / wireless / hostap / hostap_ap.c
index 08bc57a..cc18f96 100644 (file)
@@ -982,7 +982,8 @@ static void prism2_send_mgmt(struct net_device *dev,
        meta->tx_cb_idx = tx_cb_idx;
 
        skb->dev = dev;
-       skb->mac.raw = skb->nh.raw = skb->data;
+       skb_reset_mac_header(skb);
+       skb->nh.raw = skb->data;
        dev_queue_xmit(skb);
 }
 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
@@ -1100,15 +1101,13 @@ static struct sta_info * ap_add_sta(struct ap_data *ap, u8 *addr)
 {
        struct sta_info *sta;
 
-       sta = (struct sta_info *)
-               kmalloc(sizeof(struct sta_info), GFP_ATOMIC);
+       sta = kzalloc(sizeof(struct sta_info), GFP_ATOMIC);
        if (sta == NULL) {
                PDEBUG(DEBUG_AP, "AP: kmalloc failed\n");
                return NULL;
        }
 
        /* initialize STA info data */
-       memset(sta, 0, sizeof(struct sta_info));
        sta->local = ap->local;
        skb_queue_head_init(&sta->tx_buf);
        memcpy(sta->addr, addr, ETH_ALEN);
@@ -1255,7 +1254,7 @@ static char * ap_auth_make_challenge(struct ap_data *ap)
                        return NULL;
        }
 
-       tmpbuf = (char *) kmalloc(WLAN_AUTH_CHALLENGE_LEN, GFP_ATOMIC);
+       tmpbuf = kmalloc(WLAN_AUTH_CHALLENGE_LEN, GFP_ATOMIC);
        if (tmpbuf == NULL) {
                PDEBUG(DEBUG_AP, "AP: kmalloc failed for challenge\n");
                return NULL;