From patchwork Sat Mar 30 10:04:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devendra Naga X-Patchwork-Id: 2367331 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6AA5FDF24C for ; Sat, 30 Mar 2013 10:04:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754293Ab3C3KEx (ORCPT ); Sat, 30 Mar 2013 06:04:53 -0400 Received: from mail-da0-f49.google.com ([209.85.210.49]:36267 "EHLO mail-da0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753330Ab3C3KEx (ORCPT ); Sat, 30 Mar 2013 06:04:53 -0400 Received: by mail-da0-f49.google.com with SMTP id t11so485490daj.22 for ; Sat, 30 Mar 2013 03:04:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=HCJCWEEuYcQxbWBBKQRn05XTeUga80C0h6DuaCOyGbk=; b=Rn/cHp7OLxvh3aQX0aI0Nk+qiXVRTkD9lcpKNBiYEZZgiICCVwgghdTtJp9IQH8B+J 69oyxKZ7wf8uyqIBdxgiOJEIIquU02gPb3UKZuDWN8gf5/ivQGJGR/eTPe9bQvCC/tZi bOp7EEhZ4xU9JPTkfaWiecyTG9NVHFnU0L6gLGpGawxYpNLpo1MO1uDlUVhrLH3sfEcp SX9ikqQTi4n8R3v4SgV7pN75EtH5NfKJvW5r55cQj1JVvShQYzGIrUks4S3t5bU2vgRu UqBQuVnmi0J3rZrYJWCvgztwBfuskKtkEEWQIOZ50HHrxW2ouvKW18EGW0q+JLtjhN15 eVXg== X-Received: by 10.66.26.44 with SMTP id i12mr8911433pag.151.1364637892926; Sat, 30 Mar 2013 03:04:52 -0700 (PDT) Received: from localhost.net ([203.123.187.226]) by mx.google.com with ESMTPS id qd8sm6052252pbc.29.2013.03.30.03.04.49 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 30 Mar 2013 03:04:51 -0700 (PDT) From: Devendra Naga To: Zhang Rui , linux-pm@vger.kernel.org Cc: Devendra Naga Subject: [PATCH] thermal: fair_share: check for a valid thermal zone device Date: Sat, 30 Mar 2013 15:34:37 +0530 Message-Id: <1364637877-28068-1-git-send-email-devendra.aaru@gmail.com> X-Mailer: git-send-email 1.8.1.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org to be on safe side check for a valid thermal zone device and fail if there is no thermal zone device. Signed-off-by: Devendra Naga --- drivers/thermal/fair_share.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/fair_share.c b/drivers/thermal/fair_share.c index 792479f..4cd1d47 100644 --- a/drivers/thermal/fair_share.c +++ b/drivers/thermal/fair_share.c @@ -85,7 +85,7 @@ static int fair_share_throttle(struct thermal_zone_device *tz, int trip) int i; int cur_trip_level = get_trip_level(tz); - if (!tz->tzp || !tz->tzp->tbp) + if (!tz || !tz->tzp || !tz->tzp->tbp) return -EINVAL; tzp = tz->tzp;