Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751183AbWCKPMR (ORCPT ); Sat, 11 Mar 2006 10:12:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751203AbWCKPMR (ORCPT ); Sat, 11 Mar 2006 10:12:17 -0500 Received: from mailout.stusta.mhn.de ([141.84.69.5]:17929 "HELO mailout.stusta.mhn.de") by vger.kernel.org with SMTP id S1751183AbWCKPLz (ORCPT ); Sat, 11 Mar 2006 10:11:55 -0500 Date: Sat, 11 Mar 2006 16:11:54 +0100 From: Adrian Bunk To: "Brown, Len" Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [2.6 patch] drivers/acpi/video.c: fix a NULL pointer dereference Message-ID: <20060311151154.GR21864@stusta.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11+cvs20060126 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1882 Lines: 63 On Fri, Mar 10, 2006 at 11:00:45PM -0500, Brown, Len wrote: > > >The Coverity checker spotted this obvious bug in > >acpi_video_device_lcd_query_levels(). > > > > > > > >Signed-off-by: Adrian Bunk > > > >--- linux-2.6.16-rc5-mm3-full/drivers/acpi/video.c.old > >2006-03-10 18:04:18.000000000 +0100 > >+++ linux-2.6.16-rc5-mm3-full/drivers/acpi/video.c > >2006-03-10 18:04:33.000000000 +0100 > >@@ -321,11 +321,11 @@ acpi_video_device_lcd_query_levels(struc > > > > status = acpi_evaluate_object(device->handle, "_BCL", > >NULL, &buffer); > > if (!ACPI_SUCCESS(status)) > > return_VALUE(status); > > obj = (union acpi_object *)buffer.pointer; > >- if (!obj && (obj->type != ACPI_TYPE_PACKAGE)) { > >+ if (obj && (obj->type != ACPI_TYPE_PACKAGE)) { > > how about > + if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { >... Yes, thanks for the correction. cu Adrian <-- snip --> The Coverity checker spotted this bug in acpi_video_device_lcd_query_levels(). Signed-off-by: Adrian Bunk --- linux-2.6.16-rc5-mm3-full/drivers/acpi/video.c.old 2006-03-10 18:04:18.000000000 +0100 +++ linux-2.6.16-rc5-mm3-full/drivers/acpi/video.c 2006-03-10 18:04:33.000000000 +0100 @@ -321,11 +321,11 @@ acpi_video_device_lcd_query_levels(struc status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer); if (!ACPI_SUCCESS(status)) return_VALUE(status); obj = (union acpi_object *)buffer.pointer; - if (!obj && (obj->type != ACPI_TYPE_PACKAGE)) { + if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { ACPI_ERROR((AE_INFO, "Invalid _BCL data")); status = -EFAULT; goto err; } - 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/