Переглянути джерело

netlink: remove hash::nelems check in netlink_insert

The type of hash::nelems has been changed from size_t to atom_t
which in fact is int, so not need to check if BITS_PER_LONG, that
is bit number of size_t, is bigger than 32

and rht_grow_above_max() will be called to check if hashtable is
too big, ensure it can not bigger than 1<<31

Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Li RongQing 7 роки тому
батько
коміт
0041195d55
1 змінених файлів з 0 додано та 5 видалено
  1. 0 5
      net/netlink/af_netlink.c

+ 0 - 5
net/netlink/af_netlink.c

@@ -574,11 +574,6 @@ static int netlink_insert(struct sock *sk, u32 portid)
 	if (nlk_sk(sk)->bound)
 	if (nlk_sk(sk)->bound)
 		goto err;
 		goto err;
 
 
-	err = -ENOMEM;
-	if (BITS_PER_LONG > 32 &&
-	    unlikely(atomic_read(&table->hash.nelems) >= UINT_MAX))
-		goto err;
-
 	nlk_sk(sk)->portid = portid;
 	nlk_sk(sk)->portid = portid;
 	sock_hold(sk);
 	sock_hold(sk);