Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp466470ybl; Tue, 28 Jan 2020 06:24:52 -0800 (PST) X-Google-Smtp-Source: APXvYqzP6FcEHKgRkqExcNSrDDjdwjTp+cPF19yLMjvG7omgdZz0jmyBCc2BKz/2OlO9G/hsQmNh X-Received: by 2002:aca:5f85:: with SMTP id t127mr3015616oib.1.1580221491872; Tue, 28 Jan 2020 06:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221491; cv=none; d=google.com; s=arc-20160816; b=PgKJo3WUzJS20ZEo/oyNR79oBxFPfqCXw5/vxDNk6N1p9FYtW5GhIMiBhCejTVIHP5 9l182Oh1zHQJjTmTQuXCHbWHxMdgQSDO4buaosCSWDVwt9R7l9Guv7QDaRHYimHA38s4 cZqoMvCbh/oRSV66OWPOgnn+eTqkOZtnUytQI8e/1fXETFP4qM+Q58r8sAnSv4ZOvG/V Zg3OZxKwllkrcDFLQycr3kGFQKv+f2djMSTs/QqXa0JnsGMysXZchB72/oHhsjKXENgh PPIe+CdgeGt0Jht/HPMrjoelQeUtEdi91+D8MAqHynHx3PEM6omE41sSCiFj90/L8q1k irtQ== 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=4JQq/f1DTF0M0FrJw5EzZR178vP1j9VRwnexZv3Xbpw=; b=fnWnIHjQv0DZAieTNixXqDQGTs2Ur5EHUR+03PNAHt+6Y0kZGBzO3RHSUSGF49QGMu tfe0Fc0jbx7CwtCOgMA0P3ZQKQxBkLk+s2wKKMH94MBghtmfmXSqUGqtbhoMNM6M+C84 Lij3DsDwAk9LTN011oZp/ns7mREetjjtK0dkxbkoPQT9I4hoH3GaiEEMK7nZ/Zd6qBVA geaz8yIty22JZKe+ixOTCO2uklERf+wYnejMRSuhVNvJyXjxCaKkrnUUlXQuMb01yDyH MemwErH7RLkrlfAdSsdWnDue2A0iTF5ju0SovQwvijUv6lUSxO3AusZXuUZRr7t4QWkt Icjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b9YPw17E; 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 i13si8478668oth.175.2020.01.28.06.24.37; Tue, 28 Jan 2020 06:24:51 -0800 (PST) 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=b9YPw17E; 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 S1731317AbgA1OWh (ORCPT + 99 others); Tue, 28 Jan 2020 09:22:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:48404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727549AbgA1OWd (ORCPT ); Tue, 28 Jan 2020 09:22:33 -0500 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 E4BA524686; Tue, 28 Jan 2020 14:22:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221353; bh=OEcU7b+/F7+cumlbFBaYVrG3ZfIqMFdLfhcW1NhHUTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b9YPw17E7xuJj+8c2vSFZQEq6sd0YWeV+htH+2KobSbwQc+bcSFkXuTKb2mdbyMoW kkl2Rau5D6j7jjZFACR0f3dlwXgoRLYnB3nmDYqyL68B67Om6/IMBfDtRc2nVFXkIr 0ryd50p1FooWkjxwNd3VjLjGZT9LzArRyXc6X9QU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeffrey Hugo , Bjorn Andersson , Rob Clark , Sasha Levin Subject: [PATCH 4.9 154/271] drm/msm/mdp5: Fix mdp5_cfg_init error return Date: Tue, 28 Jan 2020 15:05:03 +0100 Message-Id: <20200128135904.029585964@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@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: Jeffrey Hugo [ Upstream commit fc19cbb785d7bbd1a1af26229b5240a3ab332744 ] If mdp5_cfg_init fails because of an unknown major version, a null pointer dereference occurs. This is because the caller of init expects error pointers, but init returns NULL on error. Fix this by returning the expected values on error. Fixes: 2e362e1772b8 (drm/msm/mdp5: introduce mdp5_cfg module) Signed-off-by: Jeffrey Hugo Reviewed-by: Bjorn Andersson Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c index 8b4e3004f4518..86b0448d2ce58 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c @@ -542,7 +542,7 @@ fail: if (cfg_handler) mdp5_cfg_destroy(cfg_handler); - return NULL; + return ERR_PTR(ret); } static struct mdp5_cfg_platform *mdp5_get_config(struct platform_device *dev) -- 2.20.1