Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756634AbYBWHUR (ORCPT ); Sat, 23 Feb 2008 02:20:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751841AbYBWHUG (ORCPT ); Sat, 23 Feb 2008 02:20:06 -0500 Received: from hera.kernel.org ([140.211.167.34]:60242 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751389AbYBWHUE (ORCPT ); Sat, 23 Feb 2008 02:20:04 -0500 From: Len Brown Organization: Intel Open Source Technology Center To: Adrian Bunk Subject: Re: [2.6 patch] drivers/thermal/thermal.c: fix a check-after-use Date: Sat, 23 Feb 2008 02:19:49 -0500 User-Agent: KMail/1.9.5 Cc: Zhang Rui , Thomas Sujith , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20080220001404.GW31955@cs181133002.pp.htv.fi> In-Reply-To: <20080220001404.GW31955@cs181133002.pp.htv.fi> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802230219.50120.lenb@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1205 Lines: 36 On Tuesday 19 February 2008 19:14, Adrian Bunk wrote: > This patch fixes a check-after-use spotted by the Coverity checker. > > Signed-off-by: Adrian Bunk > > --- > 570462ca4441d8d63dfd46efe6e5b2b1c251a611 diff --git a/drivers/thermal/thermal.c b/drivers/thermal/thermal.c > index e782b3e..958654b 100644 > --- a/drivers/thermal/thermal.c > +++ b/drivers/thermal/thermal.c > @@ -308,10 +308,10 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, > struct thermal_cooling_device_instance *pos; > int result; > > - if (trip >= tz->trips || (trip < 0 && trip != THERMAL_TRIPS_NONE)) > + if (!tz || !cdev) > return -EINVAL; > > - if (!tz || !cdev) > + if (trip >= tz->trips || (trip < 0 && trip != THERMAL_TRIPS_NONE)) > return -EINVAL; > > dev = > > -- this patch no longer applies because the bogus check for a programming error was already replaced by a better check of run-time params. thanks, -len -- 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/