projects
/
linux-flexiantxendom0-3.2.10.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update to 3.4-final.
[linux-flexiantxendom0-3.2.10.git]
/
net
/
netfilter
/
ipset
/
ip_set_hash_ipportip.c
diff --git
a/net/netfilter/ipset/ip_set_hash_ipportip.c
b/net/netfilter/ipset/ip_set_hash_ipportip.c
index
9134057
..
52f79d8
100644
(file)
--- a/
net/netfilter/ipset/ip_set_hash_ipportip.c
+++ b/
net/netfilter/ipset/ip_set_hash_ipportip.c
@@
-467,6
+467,7
@@
hash_ipportip_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
struct ip_set_hash *h;
u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
u8 hbits;
struct ip_set_hash *h;
u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
u8 hbits;
+ size_t hsize;
if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
return -IPSET_ERR_INVALID_FAMILY;
if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
return -IPSET_ERR_INVALID_FAMILY;
@@
-494,9
+495,12
@@
hash_ipportip_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
h->timeout = IPSET_NO_TIMEOUT;
hbits = htable_bits(hashsize);
h->timeout = IPSET_NO_TIMEOUT;
hbits = htable_bits(hashsize);
- h->table = ip_set_alloc(
- sizeof(struct htable)
- + jhash_size(hbits) * sizeof(struct hbucket));
+ hsize = htable_size(hbits);
+ if (hsize == 0) {
+ kfree(h);
+ return -ENOMEM;
+ }
+ h->table = ip_set_alloc(hsize);
if (!h->table) {
kfree(h);
return -ENOMEM;
if (!h->table) {
kfree(h);
return -ENOMEM;