Re: [Linux-zigbee-devel] [PATCH 2/2] Change lowpan_rcv so skb is freed within function and fix return values.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 31, 2014 at 07:54:27AM +0200, Alexander Aring wrote:
...
> >  
> >  	raw_dump_inline(NULL,
> > @@ -179,10 +179,10 @@ static int skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr,
> >  
> >  	new = skb_copy_expand(skb, sizeof(struct ipv6hdr),
> >  			      skb_tailroom(skb), GFP_ATOMIC);
> > -	kfree_skb(skb);
> > -
> >  	if (!new)
> > -		return -ENOMEM;
> > +		return -1;
> > +
> > +	kfree_skb(skb);
> 
> This leaks memory here, move kfree_skb above the condition after the
> skb_copy_expand. This should be also a consume_skb or dev_kfree_skb, we
> should not mix these function in this file and use only one of them.
> 
> We need another patch for this.
>

Ah, no there is no memory leaking sorry. You removed also the
kfree_skb(skb) in the drop label and we do this at one place to detect if
an error occur.

Maybe we can return the errno at the drop label and set err = -ENOMEM
and do a goto drop.

- Alex

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux