Skip to contentSkip to conversation

openvswitch: Support conntrack zone limit (fwd)

PATCH Julia Lawall 1 participant 1 message Apr 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Line 1814 frees something that is dereferenced on the next line.

julia

---------- Forwarded message ----------
Date: Tue, 17 Apr 2018 10:32:17 +0800
From: kbuild test robot <[email protected]>
To: [email protected]
Cc: Julia Lawall <[email protected]>
Subject: Re: [PATCH net-next 2/2] openvswitch: Support conntrack zone limit

CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Yi-Hung Wei <[email protected]>
CC: [email protected]
CC: Yi-Hung Wei <[email protected]>

Hi Yi-Hung,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url: https://github.com/0day-ci/linux/commits/Yi-Hung-Wei/openvswitch-Support-conntrack-zone-limit/20180417-085035
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago

Quoted 1 line
Quoted 1 line

net/openvswitch/conntrack.c:1815:17-39: ERROR: reference preceded by free on line 1814

# https://github.com/0day-ci/linux/commit/01487f05f032565b952e344abace672a12045d9e
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 01487f05f032565b952e344abace672a12045d9e
vim +1815 net/openvswitch/conntrack.c

c2ac6673 Joe Stringer 2015-08-26  1786
01487f05 Yi-Hung Wei  2018-04-16  1787  #if	IS_ENABLED(CONFIG_NETFILTER_CONNCOUNT)
01487f05 Yi-Hung Wei  2018-04-16  1788  static int ovs_ct_limit_init(struct net *net, struct ovs_net *ovs_net)
01487f05 Yi-Hung Wei  2018-04-16  1789  {
01487f05 Yi-Hung Wei  2018-04-16  1790  	int i;
01487f05 Yi-Hung Wei  2018-04-16  1791
01487f05 Yi-Hung Wei  2018-04-16  1792  	ovs_net->ct_limit_info = kmalloc(sizeof *ovs_net->ct_limit_info,
01487f05 Yi-Hung Wei  2018-04-16  1793  					 GFP_KERNEL);
01487f05 Yi-Hung Wei  2018-04-16  1794  	if (!ovs_net->ct_limit_info)
01487f05 Yi-Hung Wei  2018-04-16  1795  		return -ENOMEM;
01487f05 Yi-Hung Wei  2018-04-16  1796
01487f05 Yi-Hung Wei  2018-04-16  1797  	ovs_net->ct_limit_info->default_limit = OVS_CT_LIMIT_DEFAULT;
01487f05 Yi-Hung Wei  2018-04-16  1798  	ovs_net->ct_limit_info->limits =
01487f05 Yi-Hung Wei  2018-04-16  1799  		kmalloc_array(CT_LIMIT_HASH_BUCKETS, sizeof(struct hlist_head),
01487f05 Yi-Hung Wei  2018-04-16  1800  			      GFP_KERNEL);
01487f05 Yi-Hung Wei  2018-04-16  1801  	if (!ovs_net->ct_limit_info->limits) {
01487f05 Yi-Hung Wei  2018-04-16  1802  		kfree(ovs_net->ct_limit_info);
01487f05 Yi-Hung Wei  2018-04-16  1803  		return -ENOMEM;
01487f05 Yi-Hung Wei  2018-04-16  1804  	}
01487f05 Yi-Hung Wei  2018-04-16  1805
01487f05 Yi-Hung Wei  2018-04-16  1806  	for (i = 0; i < CT_LIMIT_HASH_BUCKETS; i++)
01487f05 Yi-Hung Wei  2018-04-16  1807  		INIT_HLIST_HEAD(&ovs_net->ct_limit_info->limits[i]);
01487f05 Yi-Hung Wei  2018-04-16  1808
01487f05 Yi-Hung Wei  2018-04-16  1809  	ovs_net->ct_limit_info->data =
01487f05 Yi-Hung Wei  2018-04-16  1810  		nf_conncount_init(net, NFPROTO_INET, sizeof(u32));
01487f05 Yi-Hung Wei  2018-04-16  1811
01487f05 Yi-Hung Wei  2018-04-16  1812  	if (IS_ERR(ovs_net->ct_limit_info->data)) {
01487f05 Yi-Hung Wei  2018-04-16  1813  		kfree(ovs_net->ct_limit_info->limits);
01487f05 Yi-Hung Wei  2018-04-16 @1814  		kfree(ovs_net->ct_limit_info);
01487f05 Yi-Hung Wei  2018-04-16 @1815  		return PTR_ERR(ovs_net->ct_limit_info->data);
01487f05 Yi-Hung Wei  2018-04-16  1816  	}
01487f05 Yi-Hung Wei  2018-04-16  1817  	return 0;
01487f05 Yi-Hung Wei  2018-04-16  1818  }
01487f05 Yi-Hung Wei  2018-04-16  1819

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation