netdev
[Top] [All Lists]

Re: [PATCH 11/12] orinoco: monitor mode support

To: Christoph Hellwig <hch@xxxxxx>
Subject: Re: [PATCH 11/12] orinoco: monitor mode support
From: Francois Romieu <romieu@xxxxxxxxxxxxx>
Date: Sat, 14 May 2005 19:39:47 +0200
Cc: jgarzik@xxxxxxxxx, proski@xxxxxxx, hermes@xxxxxxxxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20050514153100.GL3643@xxxxxx>
References: <20050514153100.GL3643@xxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
Christoph Hellwig <hch@xxxxxx> :
[...]
> +     skb = dev_alloc_skb(hdrlen + datalen);
> +     if (!skb) {
> +             printk(KERN_WARNING "%s: Cannot allocate skb for monitor 
> frame\n",
> +                    dev->name);
> +             err = -ENOMEM;
> +             goto drop;
> +     }
> +
> +     /* Copy the 802.11 header to the skb */
> +     memcpy(skb_put(skb, hdrlen), &(desc->frame_ctl), hdrlen);
> +     skb->mac.raw = skb->data;
> +
> +     /* If any, copy the data from the card to the skb */
> +     if (datalen > 0) {
> +             err = hermes_bap_pread(hw, IRQ_BAP, skb_put(skb, datalen),
> +                                    ALIGN(datalen, 2), rxfid,
> +                                    HERMES_802_2_OFFSET);
> +             if (err) {
> +                     printk(KERN_ERR "%s: error %d reading monitor frame\n",
> +                            dev->name, err);
> +                     goto drop;
[...]
> + drop:
> +     stats->rx_errors++;
> +     stats->rx_dropped++;
> +}

-> leak (skb).

--
Ueimor

<Prev in Thread] Current Thread [Next in Thread>