Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261158AbVCAAdu (ORCPT ); Mon, 28 Feb 2005 19:33:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261164AbVCAAdu (ORCPT ); Mon, 28 Feb 2005 19:33:50 -0500 Received: from mailfe03.swip.net ([212.247.154.65]:62952 "EHLO swip.net") by vger.kernel.org with ESMTP id S261158AbVCAAdS (ORCPT ); Mon, 28 Feb 2005 19:33:18 -0500 X-T2-Posting-ID: icQHdNe7aEavrnKIz+aKnQ== Subject: [PATCH] SELinux: null dereference in error path From: Alexander Nyberg To: akpm@osdl.org Cc: linux-kernel@vger.kernel.org, jmorris@redhat.com, sds@epoch.ncsc.mil Content-Type: text/plain Date: Tue, 01 Mar 2005 01:32:54 +0100 Message-Id: <1109637174.3839.13.camel@boxen> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 831 Lines: 26 The 'bad' label will call function that unconditionally dereferences the NULL pointer. Found by the Coverity tool Signed-off-by: Alexander Nyberg ===== security/selinux/ss/policydb.c 1.16 vs edited ===== --- 1.16/security/selinux/ss/policydb.c 2005-01-15 23:01:45 +01:00 +++ edited/security/selinux/ss/policydb.c 2005-02-26 12:47:44 +01:00 @@ -773,7 +773,7 @@ static int class_read(struct policydb *p cladatum = kmalloc(sizeof(*cladatum), GFP_KERNEL); if (!cladatum) { rc = -ENOMEM; - goto bad; + goto out; } memset(cladatum, 0, sizeof(*cladatum)); - 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/