Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261203AbVCTNOW (ORCPT ); Sun, 20 Mar 2005 08:14:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262150AbVCTNOW (ORCPT ); Sun, 20 Mar 2005 08:14:22 -0500 Received: from mail-in-06.arcor-online.net ([151.189.21.46]:56272 "EHLO mail-in-06.arcor-online.net") by vger.kernel.org with ESMTP id S261203AbVCTNOU (ORCPT ); Sun, 20 Mar 2005 08:14:20 -0500 From: Bodo Eggert <7eggert@gmx.de> Subject: Re: [PATCH] don't do pointless NULL checks and casts before kfree() in security/ To: Ralph Corderoy , Jesper Juhl , linux-kernel Reply-To: 7eggert@gmx.de Date: Sun, 20 Mar 2005 14:18:43 +0100 References: User-Agent: KNode/0.7.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-Id: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 579 Lines: 10 Ralph Corderoy wrote: > Hi Jesper, >> kfree() handles NULL pointers, so checking a pointer for NULL before >> calling kfree() on it is pointless. > > Not necessarily. It helps tell the reader that the pointer may be NULL > at that point. This has come up before. If you want to comment code, use comments. - 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/