Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932253Ab1C3LZD (ORCPT ); Wed, 30 Mar 2011 07:25:03 -0400 Received: from mail-qw0-f46.google.com ([209.85.216.46]:46201 "EHLO mail-qw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755094Ab1C3LZB (ORCPT ); Wed, 30 Mar 2011 07:25:01 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=njPFbiRNGMz636OF67g0+2gYNeqGnRbZ7G98CRdQCMGMTEfn2Xq/328T529/bC1DQ6 Z8BU9XE5vpcrpMXQevjeWEjsF928YMxhG894Pxx5Wm2afcd+nQgAzF/DIfsk5NWgc/UT AJ/IAdL1ffJyzYlmfboOxa7+43Kxu3s4FoIbA= MIME-Version: 1.0 In-Reply-To: References: <9bde694e1003020554p7c8ff3c2o4ae7cb5d501d1ab9@mail.gmail.com> <1300960540.32158.13.camel@e102109-lin.cambridge.arm.com> <1301395206.583.53.camel@e102109-lin.cambridge.arm.com> <1301399454.583.66.camel@e102109-lin.cambridge.arm.com> <1301476505.29074.47.camel@e102109-lin.cambridge.arm.com> Date: Wed, 30 Mar 2011 14:24:59 +0300 X-Google-Sender-Auth: KvC7MfIQxgX5fOuinasIvjaV3t0 Message-ID: Subject: Re: kmemleak for MIPS From: Daniel Baluta To: Maxin John Cc: naveen yadav , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Catalin Marinas , Eric Dumazet Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1056 Lines: 34 We have: > UDP hash table entries: 128 (order: 0, 4096 bytes) > CONFIG_BASE_SMALL=0 udp_table_init looks like: if (!CONFIG_BASE_SMALL) table->hash = alloc_large_system_hash(name, .. &table->mask); /* * Make sure hash table has the minimum size */ Since CONFIG_BASE_SMALL is 0, we are allocating the hash using alloc_large_system Then: if (CONFIG_BASE_SMALL || table->mask < UDP_HTABLE_SIZE_MIN - 1) { table->hash = kmalloc(); table->mask is 127, and UDP_HTABLE_SIZE_MIN is 256, so we are allocating again table->hash without freeing already allocated memory. We could free table->hash, before allocating the memory with kmalloc. I don't fully understand the condition table->mask < UDP_HTABLE_SIZE_MIN - 1. Eric? thanks, Daniel. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/