Subject: Re: [PATCH] Fix slab corruption with netem

From: Stephen Hemminger <[email-masked]>
Date: Sat, 15 Jul 2006 16:34:10 -0700

Guillaume Chazarain wrote:
> Stephen Hemminger wrote :
>>> -    struct netem_skb_cb *cb = (struct netem_skb_cb *)skb->cb;
>>> +    /* We don't fill cb now as skb_unshare() may invalidate it */
>>> +    struct netem_skb_cb *cb = NULL;
>>>   
>> Would rather leave it unitialized, rather than setting to NULL.
>
> I find that strange. If someone mistakenly uses cb before it is 
> initialized it could be hard
> to figure out why some memory is corrupted. But by initializing cb to 
> NULL, it will
> always trigger an Oops, so it will be easier to debug in this case.
>
> Cheers.
>
Gcc will complain if variable is used before initialized, and I would 
rather see it at compile time than runtime.