@@ -1018,6 +1018,7 @@ static TfwCfgSrvGroup *
1018
1018
__tfw_cfgop_new_sg_cfg (const char * name , unsigned int len )
1019
1019
{
1020
1020
TfwCfgSrvGroup * sg_cfg = kmem_cache_alloc (tfw_sg_cfg_cache , GFP_KERNEL );
1021
+
1021
1022
if (!sg_cfg )
1022
1023
return NULL ;
1023
1024
@@ -1842,11 +1843,12 @@ static int
1842
1843
tfw_cfgop_in_sched (TfwCfgSpec * cs , TfwCfgEntry * ce )
1843
1844
{
1844
1845
if (TFW_CFGOP_HAS_DFLT (ce , sched )) {
1845
- tfw_cfg_sg -> parsed_sg -> sched = tfw_cfg_sg_opts -> parsed_sg -> sched ;
1846
+ tfw_cfg_sg -> parsed_sg -> sched =
1847
+ tfw_cfg_sg_opts -> parsed_sg -> sched ;
1846
1848
tfw_cfg_sg -> sched_flags = tfw_cfg_sg_opts -> sched_flags ;
1847
- tfw_cfgop_sg_copy_sched_arg ( & tfw_cfg_sg -> sched_arg ,
1848
- tfw_cfg_sg_opts -> sched_arg );
1849
- return 0 ;
1849
+
1850
+ return tfw_cfgop_sg_copy_sched_arg ( & tfw_cfg_sg -> sched_arg ,
1851
+ tfw_cfg_sg_opts -> sched_arg ) ;
1850
1852
}
1851
1853
return tfw_cfgop_sched (cs , ce , & tfw_cfg_sg -> parsed_sg -> sched ,
1852
1854
& tfw_cfg_sg -> sched_arg ,
@@ -1979,8 +1981,8 @@ tfw_sock_srv_cfgclean(void)
1979
1981
static int
1980
1982
tfw_sock_srv_cfgend (void )
1981
1983
{
1982
- int r ;
1983
1984
TfwCfgSrvGroup * sg_cfg ;
1985
+ int r ;
1984
1986
1985
1987
/* Check health monitor existence for configured server groups. */
1986
1988
list_for_each_entry (sg_cfg , & sg_cfg_list , list )
@@ -2002,13 +2004,17 @@ tfw_sock_srv_cfgend(void)
2002
2004
/* Options for implicit group are not filled, use current defaults. */
2003
2005
tfw_cfgop_sg_copy_opts (tfw_cfg_sg_def -> parsed_sg ,
2004
2006
tfw_cfg_sg_opts -> parsed_sg );
2005
- tfw_cfgop_sg_copy_sched_arg (& tfw_cfg_sg_def -> sched_arg ,
2006
- tfw_cfg_sg_opts -> sched_arg );
2007
+
2008
+ r = tfw_cfgop_sg_copy_sched_arg (& tfw_cfg_sg_def -> sched_arg ,
2009
+ tfw_cfg_sg_opts -> sched_arg );
2010
+ if (unlikely (r ))
2011
+ return r ;
2007
2012
tfw_cfg_sg_def -> parsed_sg -> sched = tfw_cfg_sg_opts -> parsed_sg -> sched ;
2008
2013
tfw_cfg_sg_def -> nip_flags = tfw_cfg_sg_opts -> nip_flags ;
2009
2014
tfw_cfg_sg_def -> sched_flags = tfw_cfg_sg_opts -> sched_flags ;
2010
2015
2011
- if ((r = tfw_cfgop_setup_srv_group (tfw_cfg_sg_def )))
2016
+ r = tfw_cfgop_setup_srv_group (tfw_cfg_sg_def );
2017
+ if (unlikely (r ))
2012
2018
return r ;
2013
2019
tfw_cfg_sg_def = NULL ;
2014
2020
@@ -2463,8 +2469,10 @@ tfw_sock_srv_init(void)
2463
2469
2464
2470
tfw_sg_cfg_cache = kmem_cache_create ("tfw_sg_cfg_cache" ,
2465
2471
sizeof (TfwCfgSrvGroup ), 0 , 0 , NULL );
2466
- if (!tfw_sg_cfg_cache )
2472
+ if (!tfw_sg_cfg_cache ) {
2473
+ kmem_cache_destroy (tfw_srv_conn_cache );
2467
2474
return - ENOMEM ;
2475
+ }
2468
2476
2469
2477
tfw_mod_register (& tfw_sock_srv_mod );
2470
2478
0 commit comments