Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932201AbVIRVEm (ORCPT ); Sun, 18 Sep 2005 17:04:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932203AbVIRVEm (ORCPT ); Sun, 18 Sep 2005 17:04:42 -0400 Received: from clock-tower.bc.nu ([81.2.110.250]:33185 "EHLO lxorguk.ukuu.org.uk") by vger.kernel.org with ESMTP id S932201AbVIRVEl (ORCPT ); Sun, 18 Sep 2005 17:04:41 -0400 Subject: Re: p = kmalloc(sizeof(*p), ) From: Alan Cox To: Al Viro Cc: Linus Torvalds , Willy Tarreau , Robert Love , Russell King , Linux Kernel List In-Reply-To: <20050918190714.GO19626@ftp.linux.org.uk> References: <20050918100627.GA16007@flint.arm.linux.org.uk> <1127061146.6939.6.camel@phantasy> <20050918165219.GA595@alpha.home.local> <20050918171845.GL19626@ftp.linux.org.uk> <20050918190714.GO19626@ftp.linux.org.uk> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sun, 18 Sep 2005 22:30:26 +0100 Message-Id: <1127079026.8932.13.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 656 Lines: 18 > It would be very useful when e.g. tracking down improper uses of > struct file, struct dentry, etc. - stuff that should always be > allocated by one helper function. Same goes for e.g. net_device - Another useful trick here btw is to make such objects contain (when debugging) void *magic_ptr; which is initialised as foo->magic_ptr = foo; That catches anyone copying them and tells you what got copied - 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/