Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp111440ybg; Mon, 8 Jun 2020 17:55:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwksd20ij3zgG34IEeSanKAB43HtUdzg5XazhzwHeQ4Q+sbg2ZYKPqcsY/I2Xosy5jWUrl9 X-Received: by 2002:a05:6402:c1a:: with SMTP id co26mr23724685edb.207.1591664151509; Mon, 08 Jun 2020 17:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664151; cv=none; d=google.com; s=arc-20160816; b=wrEqj4c34C7Fb23TrEGwoMYpi/xHg9d2G3Ayks4OgELr9eL5UaIyMbcERYOPC9QfCm T0tYAf6Z/SM8+Edp2+UnF/e0UE7+uVv3JoFhCZKA+PAGBrbFBFpt7nFAnnMywVcFFGip ijJkyLsOuTbtU9RIANaRsTpUD+lsjotVl+ZOGae71Ess8u/PkLOmhdSHSSRuxqTMXzeo 0YRiBFZ5phXi4vvjVNAbnMwDSE++n3gTyxkxJpaMBj5IiXLBJNimUCvMw5baFSGxRHyI 38ZothmzZzWe1JrsjCUPyJyca58GUe09ixSs8XuYxrBAUUmdQnd+quydaFtqMx8pfJYa sB4w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bKFv3cqGKiponC2KyC8eNwKX1M9AKURKnTQbQc3r+yU=; b=PvKl0qMiCPy/DDHtIiSXJDwtuOp3l5sQk7ir3BTQ7sC+5Zv+s6lzJ7TfLBrC1Knb5K J5z3HLa5S9UZ+wa4R4/CmtL63s7ibFt4YOXCE8myUaWHkBrPLWwQbAhkHAjiTXPMP7ta UE2FeRQ22y+Yc3EgHP+bx11uTPIW9W1SQv1G5ky0X6lDlRJzW+0qMaCML8xED5nb9KU7 p9PrX0EIyDrUq1RYidSBHaAYrmQt/WovvHPN7z8yZxejEn8TRZAsnVzeO5yHG4PRdG1o 2VZWM6YOUqxAtUmOOyukef5wNON080/hjsr8bl3iTubv0UQSB4EA7Z7NHFsM310R+FEx OYHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vJ3AvlcE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt17si13220710ejc.457.2020.06.08.17.55.28; Mon, 08 Jun 2020 17:55:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vJ3AvlcE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728757AbgFIAvx (ORCPT + 99 others); Mon, 8 Jun 2020 20:51:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:56324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728591AbgFHXKN (ORCPT ); Mon, 8 Jun 2020 19:10:13 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A7B09208C7; Mon, 8 Jun 2020 23:10:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657813; bh=3BabQJM6BN1aJZwxaMkpymzATSEqgRe2H4GvW+yQVss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vJ3AvlcE2HUrn+CuknAcK54VNNwCssa9QazWO3UXivaDzRpyX8HyzW+r/nzN19TpP oHkA+XaIl3oA+eLZh7EBssgIHi4LZYNuNvWOYOUwY+GxvpyngPlIBSvLtfMYSEVhmz M7AMDcmyJvwqmvfNKQj6AUHB7rClE4W9suVRXXZo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wei Yongjun , Linus Walleij , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.7 188/274] drm/mcde: dsi: Fix return value check in mcde_dsi_bind() Date: Mon, 8 Jun 2020 19:04:41 -0400 Message-Id: <20200608230607.3361041-188-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun [ Upstream commit 761e9f4f80a21a4b845097027030bef863001636 ] The of_drm_find_bridge() function returns NULL on error, it doesn't return error pointers so this check doesn't work. Fixes: 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE") Signed-off-by: Wei Yongjun Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20200430073145.52321-1-weiyongjun1@huawei.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/mcde/mcde_dsi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c index 7af5ebb0c436..e705afc08c4e 100644 --- a/drivers/gpu/drm/mcde/mcde_dsi.c +++ b/drivers/gpu/drm/mcde/mcde_dsi.c @@ -1073,10 +1073,9 @@ static int mcde_dsi_bind(struct device *dev, struct device *master, panel = NULL; bridge = of_drm_find_bridge(child); - if (IS_ERR(bridge)) { - dev_err(dev, "failed to find bridge (%ld)\n", - PTR_ERR(bridge)); - return PTR_ERR(bridge); + if (!bridge) { + dev_err(dev, "failed to find bridge\n"); + return -EINVAL; } } } -- 2.25.1