Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2074897ybp; Thu, 10 Oct 2019 01:44:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqy289uqXY2amP2rZZ8qSEwdBbkd9WbFtVxXYk7XFE4fEnnDexPjcTEUniFn11ATz8aEwjkI X-Received: by 2002:a17:906:b6c6:: with SMTP id ec6mr7048947ejb.54.1570697040891; Thu, 10 Oct 2019 01:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570697040; cv=none; d=google.com; s=arc-20160816; b=sOxJzjHu3GPzjCFO9pEO8OuDsj+E69ObgXDlW0LICuBqeJktA8eSfxpIIV1rSAESB1 RK6/rHHEj6WODgPZh16yDvt+zPL5l76QLMqsRcENdP0cVnpze0gdQJU04VhNc11DwJYO tQ1IT0AtNvGI8LzcPpKvc1COpGgPPe2y+J0tQiM1NqoGmekwvD7QsulpGz/v4ntC0nNW 9BEZv22BzeJgzuJO1tl7WE8Nq5nnEjSr+DfZp1LqA/C4nYPiqs/WQ6v9+dmmkmhI9PnX r1Nay/6Cu21ftuoVEMxha0/U7j2MMx//KZTw2J41n5ZNm5wvRCxhnIqMwiA5bpQ8UCoT syHQ== 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=6Sn0VlAn8HH3YZygjqxqKwv6C7xBzzghgcQkUVRhupQ=; b=uxpolHubJLQOp+4Tjw7lG4pvzbLb0T1jnk4HyzSySxnQEN511G0uo8Xo8v0gexK0/s tAbSp8ANlCRd8wv75rBgkNVdpcGaw4xILrmEY3LrWLgIS51HMHirQ3Z6jPcVr7QtpwVH ZerLAR4bim7A7J42VegNjwesb1TEY7Anksua10ezZzQEJzf7ewzcOpHLMoE3YAZ5/XWq v63bHdndRzOkb7f2a5BHZFoScoTa/EPlAZffMQZf404w3Faq9qqYHp211Zam5NjfcJIG rO5puIPuu8Eg5Q+AcJW8bIHXaT1nYIWs7a5Z3cZBmfFCVLiM9NZvLERNxdvlqNzT6bEU eTDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="j4+fRh/t"; 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 17si2717791ejt.431.2019.10.10.01.43.37; Thu, 10 Oct 2019 01:44:00 -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="j4+fRh/t"; 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 S2388124AbfJJIkc (ORCPT + 99 others); Thu, 10 Oct 2019 04:40:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:44606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387493AbfJJIka (ORCPT ); Thu, 10 Oct 2019 04:40:30 -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 9749720B7C; Thu, 10 Oct 2019 08:40:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696830; bh=AYCAce8R8+1AGpgdpdakmyUkNlhCjR6dQ3fDZMXkhHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j4+fRh/t7nN9GpBhYpv1raWa92g8DzlzxFv3WoiUFp6yHeeYOPvO1EJq5k/kZBtGB QEcWZRLI4jWVqQiu+Urz6mEea64I7hEP5ucrIgW1ZoFSfkdatUGPzt99opcTnDqU+t zWQewcrtARCMHnhE8GZtRUJGZ/N8CfCmz0LHs+sk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sibi Sankar , Sean Paul , Rob Clark Subject: [PATCH 5.3 067/148] drm/msm/dsi: Fix return value check for clk_get_parent Date: Thu, 10 Oct 2019 10:35:28 +0200 Message-Id: <20191010083615.502085657@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@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: Sean Paul commit 5fb9b797d5ccf311ae4aba69e86080d47668b5f7 upstream. clk_get_parent returns an error pointer upon failure, not NULL. So the checks as they exist won't catch a failure. This patch changes the checks and the return values to properly handle an error pointer. Fixes: c4d8cfe516dc ("drm/msm/dsi: add implementation for helper functions") Cc: Sibi Sankar Cc: Sean Paul Cc: Rob Clark Cc: # v4.19+ Signed-off-by: Sean Paul Signed-off-by: Rob Clark Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/msm/dsi/dsi_host.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -421,15 +421,15 @@ static int dsi_clk_init(struct msm_dsi_h } msm_host->byte_clk_src = clk_get_parent(msm_host->byte_clk); - if (!msm_host->byte_clk_src) { - ret = -ENODEV; + if (IS_ERR(msm_host->byte_clk_src)) { + ret = PTR_ERR(msm_host->byte_clk_src); pr_err("%s: can't find byte_clk clock. ret=%d\n", __func__, ret); goto exit; } msm_host->pixel_clk_src = clk_get_parent(msm_host->pixel_clk); - if (!msm_host->pixel_clk_src) { - ret = -ENODEV; + if (IS_ERR(msm_host->pixel_clk_src)) { + ret = PTR_ERR(msm_host->pixel_clk_src); pr_err("%s: can't find pixel_clk clock. ret=%d\n", __func__, ret); goto exit; }