Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-29 Thread Jan Engelhardt
On Wednesday 2017-03-29 11:15, SIMRAN SINGHAL wrote: >> dest = kzalloc(sizeof(struct ip_vs_dest), GFP_KERNEL); >>- if (dest == NULL) >>+ if (!dest) >> return -ENOMEM; > >But, according to me we should prefer !var over ( var ==NULL ) according to the

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-29 Thread Jan Engelhardt
On Wednesday 2017-03-29 11:15, SIMRAN SINGHAL wrote: >> dest = kzalloc(sizeof(struct ip_vs_dest), GFP_KERNEL); >>- if (dest == NULL) >>+ if (!dest) >> return -ENOMEM; > >But, according to me we should prefer !var over ( var ==NULL ) according to the

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-29 Thread SIMRAN SINGHAL
On Wed, Mar 29, 2017 at 2:19 PM, SIMRAN SINGHAL wrote: > On Wed, Mar 29, 2017 at 12:25 PM, Jan Engelhardt wrote: >> >> On Tuesday 2017-03-28 18:23, SIMRAN SINGHAL wrote: >>>On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt wrote: On

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-29 Thread SIMRAN SINGHAL
On Wed, Mar 29, 2017 at 2:19 PM, SIMRAN SINGHAL wrote: > On Wed, Mar 29, 2017 at 12:25 PM, Jan Engelhardt wrote: >> >> On Tuesday 2017-03-28 18:23, SIMRAN SINGHAL wrote: >>>On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt wrote: On Tuesday 2017-03-28 15:13, simran singhal wrote:

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-29 Thread SIMRAN SINGHAL
On Wed, Mar 29, 2017 at 12:25 PM, Jan Engelhardt wrote: > > On Tuesday 2017-03-28 18:23, SIMRAN SINGHAL wrote: >>On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt wrote: >>> On Tuesday 2017-03-28 15:13, simran singhal wrote: >>> Some functions like

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-29 Thread SIMRAN SINGHAL
On Wed, Mar 29, 2017 at 12:25 PM, Jan Engelhardt wrote: > > On Tuesday 2017-03-28 18:23, SIMRAN SINGHAL wrote: >>On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt wrote: >>> On Tuesday 2017-03-28 15:13, simran singhal wrote: >>> Some functions like kmalloc/kzalloc return NULL on failure. When

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-29 Thread Jan Engelhardt
On Tuesday 2017-03-28 18:23, SIMRAN SINGHAL wrote: >On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt wrote: >> On Tuesday 2017-03-28 15:13, simran singhal wrote: >> >>>Some functions like kmalloc/kzalloc return NULL on failure. When NULL >>>represents failure, !x is commonly

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-29 Thread Jan Engelhardt
On Tuesday 2017-03-28 18:23, SIMRAN SINGHAL wrote: >On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt wrote: >> On Tuesday 2017-03-28 15:13, simran singhal wrote: >> >>>Some functions like kmalloc/kzalloc return NULL on failure. When NULL >>>represents failure, !x is commonly used. >>> >>>@@

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-28 Thread SIMRAN SINGHAL
On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt wrote: > On Tuesday 2017-03-28 15:13, simran singhal wrote: > >>Some functions like kmalloc/kzalloc return NULL on failure. When NULL >>represents failure, !x is commonly used. >> >>@@ -910,7 +910,7 @@ ip_vs_new_dest(struct

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-28 Thread SIMRAN SINGHAL
On Tue, Mar 28, 2017 at 7:24 PM, Jan Engelhardt wrote: > On Tuesday 2017-03-28 15:13, simran singhal wrote: > >>Some functions like kmalloc/kzalloc return NULL on failure. When NULL >>represents failure, !x is commonly used. >> >>@@ -910,7 +910,7 @@ ip_vs_new_dest(struct ip_vs_service *svc,

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-28 Thread Jan Engelhardt
On Tuesday 2017-03-28 15:13, simran singhal wrote: >Some functions like kmalloc/kzalloc return NULL on failure. When NULL >represents failure, !x is commonly used. > >@@ -910,7 +910,7 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct >ip_vs_dest_user_kern *udest, > } > > dest =

Re: [PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-28 Thread Jan Engelhardt
On Tuesday 2017-03-28 15:13, simran singhal wrote: >Some functions like kmalloc/kzalloc return NULL on failure. When NULL >represents failure, !x is commonly used. > >@@ -910,7 +910,7 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct >ip_vs_dest_user_kern *udest, > } > > dest =

[PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-28 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. Signed-off-by: simran singhal --- v2: -squash all the patches of the patch-set. net/netfilter/ipvs/ip_vs_ctl.c | 4 ++--

[PATCH v2] netfilter: Clean up tests if NULL returned on failure

2017-03-28 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure. When NULL represents failure, !x is commonly used. Signed-off-by: simran singhal --- v2: -squash all the patches of the patch-set. net/netfilter/ipvs/ip_vs_ctl.c | 4 ++-- net/netfilter/ipvs/ip_vs_dh.c| 2 +-