[Question]No memory release after enlarge fib_info hash table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



linux 2.6.12.3

net/ipv4/fib_semantics.c:line 679


       if (fib_info_cnt >= fib_hash_size) {
               unsigned int new_size = fib_hash_size << 1;
               struct hlist_head *new_info_hash;
               struct hlist_head *new_laddrhash;
               unsigned int bytes;

               if (!new_size)
                       new_size = 1;
               bytes = new_size * sizeof(struct hlist_head *);
               new_info_hash = fib_hash_alloc(bytes);
               new_laddrhash = fib_hash_alloc(bytes);
               if (!new_info_hash || !new_laddrhash) {
                       fib_hash_free(new_info_hash, bytes);
                       fib_hash_free(new_laddrhash, bytes);
               } else {
                       memset(new_info_hash, 0, bytes);
                       memset(new_laddrhash, 0, bytes);

fib_hash_move(new_info_hash, new_laddrhash, new_size);
               }

               if (!fib_hash_size)
                       goto failure;
       }

In fib_hash_move, there is no code call fib_hash_free to release memory used by old hash table. after call fib_hash_move, fib_info_hash and fib_info_laddrhash are the new memory addresses , old addresses are lost. Is this a bug?

                                  thanks
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux