Re: [PATCH] fib_trie: coding style: Use pointer after check

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

 



From: Firo Yang <firogm@xxxxxxxxx>
Date: Mon,  8 Jun 2015 11:54:51 +0800

> As Alexander Duyck pointed out that:
> struct tnode {
>         ...
>         struct key_vector kv[1];
> }
> The kv[1] member of struct tnode is an arry that refernced by
> a null pointer will not crash the system, like this:
> struct tnode *p = NULL;
> struct key_vector *kv = p->kv;
> As such p->kv doesn't actually dereference anything, it is simply a
> means for getting the offset to the array from the pointer p.
> 
> This patch make the code more regular to avoid making people feel
> odd when they look at the code.
> 
> Signed-off-by: Firo Yang <firogm@xxxxxxxxx>

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




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux