From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrian Bunk Subject: drivers/acpi/scan.c: inconsequent NULL handling Date: Thu, 24 Mar 2005 21:41:09 +0100 Message-ID: <20050324204109.GC3966@stusta.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-acpi@vger.kernel.org The Coverity checker found the following: <-- snip --> static int acpi_bus_match ( struct acpi_device *device, struct acpi_driver *driver) { if (driver && driver->ops.match) return driver->ops.match(device, driver); return acpi_match_ids(device, driver->ids); } <-- snip --> Either driver can be NULL, in which case the driver->ids is a possible NULL pointer reference, or it can't, in which case the check whether it's NULL is superfluous. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261184AbVCXUsE (ORCPT ); Thu, 24 Mar 2005 15:48:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261196AbVCXUo7 (ORCPT ); Thu, 24 Mar 2005 15:44:59 -0500 Received: from mailout.stusta.mhn.de ([141.84.69.5]:42254 "HELO mailout.stusta.mhn.de") by vger.kernel.org with SMTP id S261184AbVCXUlM (ORCPT ); Thu, 24 Mar 2005 15:41:12 -0500 Date: Thu, 24 Mar 2005 21:41:09 +0100 From: Adrian Bunk To: len.brown@intel.com Cc: acpi-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: drivers/acpi/scan.c: inconsequent NULL handling Message-ID: <20050324204109.GC3966@stusta.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org The Coverity checker found the following: <-- snip --> static int acpi_bus_match ( struct acpi_device *device, struct acpi_driver *driver) { if (driver && driver->ops.match) return driver->ops.match(device, driver); return acpi_match_ids(device, driver->ids); } <-- snip --> Either driver can be NULL, in which case the driver->ids is a possible NULL pointer reference, or it can't, in which case the check whether it's NULL is superfluous. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed