Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752182AbZA3JVM (ORCPT ); Fri, 30 Jan 2009 04:21:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752169AbZA3JU5 (ORCPT ); Fri, 30 Jan 2009 04:20:57 -0500 Received: from tundra.namei.org ([65.99.196.166]:3477 "EHLO tundra.namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752092AbZA3JU4 (ORCPT ); Fri, 30 Jan 2009 04:20:56 -0500 Date: Fri, 30 Jan 2009 20:18:34 +1100 (EST) From: James Morris To: Mimi Zohar cc: linux-kernel@vger.kernel.org, Andrew Morton , Christoph Hellwig , Dave Hansen , ", Serge Hallyn , Mimi Zohar Subject: Re: [PATCH 3/6] integrity: IMA display In-Reply-To: Message-ID: References: User-Agent: Alpine 1.10 (LRH 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 874 Lines: 28 On Thu, 29 Jan 2009, Mimi Zohar wrote: > +int ima_fs_init(void) > +{ > + ima_dir = securityfs_create_dir("ima", NULL); > + if (!ima_dir || IS_ERR(ima_dir)) > + return -1; > + > + binary_runtime_measurements = > + securityfs_create_file("binary_runtime_measurements", > + S_IRUSR | S_IRGRP, ima_dir, NULL, > + &ima_measurements_ops); > + if (!binary_runtime_measurements || IS_ERR(binary_runtime_measurements)) > + goto out; You should not be checking for NULL returns from securityfs_create_file(), because it does not return NULL (the documentation is wrong). - James -- James Morris -- 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/