Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-07 Thread Alexander Duyck
On 06/07/2015 06:23 AM, Julia Lawall wrote: I think that many people would make the same mistake when looking at the code. The change doesn't seem to hurt anything? Actually, yes. But it does imporve nothing but coding style. I think Alexander's code style make function more compact is also a g

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-07 Thread Firo Yang
On Sun, Jun 07, 2015 at 03:23:57PM +0200, Julia Lawall wrote: >> >I think that many people would make the same mistake when looking at the >> >code. The change doesn't seem to hurt anything? >> Actually, yes. But it does imporve nothing but coding style. >> I think Alexander's code style make func

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-07 Thread Julia Lawall
> >I think that many people would make the same mistake when looking at the > >code. The change doesn't seem to hurt anything? > Actually, yes. But it does imporve nothing but coding style. > I think Alexander's code style make function more compact is also a > good code style. So, just keep it or

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-07 Thread Firo Yang
On Sun, Jun 07, 2015 at 08:36:45AM +0200, Julia Lawall wrote: > > >On Sun, 7 Jun 2015, Firo Yang wrote: > >> On Sat, Jun 06, 2015 at 05:05:04AM -0700, Eric Dumazet wrote: >> >On Sat, 2015-06-06 at 19:35 +0800, Firo Yang wrote: >> >> A smatch warning. >> >> When kmem_cache_alloc() failed to alloc me

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-06 Thread Julia Lawall
On Sun, 7 Jun 2015, Firo Yang wrote: > On Sat, Jun 06, 2015 at 05:05:04AM -0700, Eric Dumazet wrote: > >On Sat, 2015-06-06 at 19:35 +0800, Firo Yang wrote: > >> A smatch warning. > >> When kmem_cache_alloc() failed to alloc memory, a null pointer > >> will be returned. Redeference null pointer w

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-06 Thread Firo Yang
On Sat, Jun 06, 2015 at 05:05:04AM -0700, Eric Dumazet wrote: >On Sat, 2015-06-06 at 19:35 +0800, Firo Yang wrote: >> A smatch warning. >> When kmem_cache_alloc() failed to alloc memory, a null pointer >> will be returned. Redeference null pointer will generate > > >Dereferencing a null pointer wil

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-06 Thread Firo Yang
On Sat, Jun 06, 2015 at 03:39:38PM +0200, walter harms wrote: > > >Am 06.06.2015 13:35, schrieb Firo Yang: >> A smatch warning. >> When kmem_cache_alloc() failed to alloc memory, a null pointer >> will be returned. Redeference null pointer will generate >> an unnecessary oops. So, use it after chec

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-06 Thread Firo Yang
On Sat, Jun 06, 2015 at 08:16:50PM -0700, Alexander Duyck wrote: >On 06/06/2015 05:05 AM, Eric Dumazet wrote: >>On Sat, 2015-06-06 at 19:35 +0800, Firo Yang wrote: >>>A smatch warning. >>>When kmem_cache_alloc() failed to alloc memory, a null pointer >>>will be returned. Redeference null pointer wi

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-06 Thread Alexander Duyck
On 06/06/2015 05:05 AM, Eric Dumazet wrote: On Sat, 2015-06-06 at 19:35 +0800, Firo Yang wrote: A smatch warning. When kmem_cache_alloc() failed to alloc memory, a null pointer will be returned. Redeference null pointer will generate Dereferencing a null pointer will crash. an unnecessary o

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-06 Thread walter harms
Am 06.06.2015 13:35, schrieb Firo Yang: > A smatch warning. > When kmem_cache_alloc() failed to alloc memory, a null pointer > will be returned. Redeference null pointer will generate > an unnecessary oops. So, use it after check. > > Signed-off-by: Firo Yang > --- > net/ipv4/fib_trie.c | 3 ++

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-06 Thread Eric Dumazet
On Sat, 2015-06-06 at 19:35 +0800, Firo Yang wrote: > A smatch warning. > When kmem_cache_alloc() failed to alloc memory, a null pointer > will be returned. Redeference null pointer will generate Dereferencing a null pointer will crash. > an unnecessary oops. So, use it after check. > > Signed-

[PATCH] fib_trie: Fix potential null pointer dereference

2015-06-06 Thread Firo Yang
A smatch warning. When kmem_cache_alloc() failed to alloc memory, a null pointer will be returned. Redeference null pointer will generate an unnecessary oops. So, use it after check. Signed-off-by: Firo Yang --- net/ipv4/fib_trie.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --