Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9938587ybi; Wed, 24 Jul 2019 12:40:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQCssFrIuYlv2OYaCJfJTLGFyci1BqiMGR8BdcdhYf57m1x9ckyHzx9/U+M2BugI19v3kP X-Received: by 2002:aa7:8dd2:: with SMTP id j18mr12717225pfr.88.1563997259756; Wed, 24 Jul 2019 12:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997259; cv=none; d=google.com; s=arc-20160816; b=01/k91hBXBxhtRvPqDBJIGX+qV7YhaFE0AmOWK8Ibkb51AR6q5lnP8XBOTeJY9rNkq e0eZS3ec1RjYR80y8YexY8hyYD1dhj0sahwGRDeymIYhJNGdXuq4Uv4POIzXkxoefKjf 12CjHbFJjRyqP7FZ8Z/oEpX+W5mGAyeEqEnPMS0s2XbHNlHRUwkbSySm2ntR93TFtGsq j1eeAPHeJUuFpBgm2QjbaFEniSMbanJLMu47B/w6uIUDjW5UTO2Ahhl+Db/swQMWKfcF CCHstpfpdDXbyDv9YMpApN4TiXHQIYOMx++VJzFrKj/aCL01GO/9DjgTbOZjkZZPAwe8 mM7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ON96QdDiDepzQmIvm0VVoVgjXfcFC+IenoSV+Bp/kc0=; b=hnuCkyoFouCLdRdowPJE+jigbCev7mpbSJM55TKoFEraQm9g1cnT/vyN5diwkdjBWi sF5BRqmTQijTmy0wDmmenjFWmzz+wYxGxDqhuYwcPgg23xwb78UWRx6UQSZe3RS6DUmj Z/iV+QOJCAcSTW95lSLbaAJI3Vgrx2MNllL0xRCL0RNTvFfvU4ZoVQ/djwmVUiYxf5LA pw8Wg9HVQ5d3EM8GHb3UKPRxxdM3AqiZZTFwmFfU4S21lzQf3seyNZ+1AXqYX1STKLct T22NuMxnEQHHM9N5NQGSi1FyjDS6A37i2YvTV5CxGG2/2ET5YsH55xCpNRlJwDnrY8bd 113g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yYMbDUsa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l62si14449260pgd.24.2019.07.24.12.40.44; Wed, 24 Jul 2019 12:40:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yYMbDUsa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389930AbfGXTj0 (ORCPT + 99 others); Wed, 24 Jul 2019 15:39:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:40422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389092AbfGXTjZ (ORCPT ); Wed, 24 Jul 2019 15:39:25 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 674AF229F3; Wed, 24 Jul 2019 19:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997164; bh=QhTgdraJMeg8h3JGFMS4X2SbX+drcBS1wC/WjCfCPYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yYMbDUsaHEdCIsEJph2Gk4QduRG2B1wDEuFazvgcj0qaYeQKvxPI5ARLTFp/6JifQ DvHl47Do6Z+E7eDNgIBrhINPthpZm9KZTIMMJZJLrFrdquR79jr4wgvz+5eRrTaKkV VdVJxCiBN8qPKeJhVMjYbZ8L08rYGWRrsE7kv3HY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Dietrich , Dmitry Osipenko , Viresh Kumar Subject: [PATCH 5.2 301/413] opp: Dont use IS_ERR on invalid supplies Date: Wed, 24 Jul 2019 21:19:52 +0200 Message-Id: <20190724191757.472117081@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Osipenko commit 560d1bcad715c215e7ffe5d7cffe045974b623d0 upstream. _set_opp_custom() receives a set of OPP supplies as its arguments and the caller of it passes NULL when the supplies are not valid. But _set_opp_custom(), by mistake, checks for error by performing IS_ERR(old_supply) on it which will always evaluate to false. The problem was spotted during of testing of upcoming update for the NVIDIA Tegra CPUFreq driver. Cc: stable Fixes: 7e535993fa4f ("OPP: Separate out custom OPP handler specific code") Reported-by: Marc Dietrich Signed-off-by: Dmitry Osipenko [ Viresh: Massaged changelog ] Signed-off-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/opp/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -682,7 +682,7 @@ static int _set_opp_custom(const struct data->old_opp.rate = old_freq; size = sizeof(*old_supply) * opp_table->regulator_count; - if (IS_ERR(old_supply)) + if (!old_supply) memset(data->old_opp.supplies, 0, size); else memcpy(data->old_opp.supplies, old_supply, size);