From patchwork Tue Jun 18 11:52:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 167147 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4116432ilk; Tue, 18 Jun 2019 04:54:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFrcIWuVwR2DWcSNF6RFssbXHFnGiMG/1Zi6ao7lTNX4eI8G+TX6aq1wB0sbLJAtXz7yUU X-Received: by 2002:a17:902:9a91:: with SMTP id w17mr16961415plp.126.1560858896535; Tue, 18 Jun 2019 04:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560858896; cv=none; d=google.com; s=arc-20160816; b=latNxL5XgwRfbEgqCpOZ+G2hT+l5kF8cgmwvjQrLYELw0rxwt5bH6FHPnxZCnstSD1 +8FPGlda6T3Z1Ho/w4cgSkqY8LWR84vrP+7yiyTRYVpJOMpxpGwOQjV8/YHVZsWVTqo/ zlYQ4IozUH8yOtd2WZyClA4cyvaZmEzQqNsEd9lcam34CZ/N75t0FktIKabpZjfT9EYg 17SNkZ6cMshzwNZzkOSoEitoLninquwi0YINIGhX2Lt7R9sYUGm+pplMM6fpbg047sU4 icGjpAJtm8/VQEx5pTLZz3DJz2sw8KeBFg/HzYbirTSR94U/OzzzTJfHD700HdkjDTqb xVJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=rbUsp/opmpGn1WJw/SoOIp8kOAWQNoLNJf5Lm2zX8iM=; b=MpFL9u7a8KEljqI7+fMRhvGfmGEeM2z2aVRA49h4n65fqTWlb4hgmzhRZpWzrSQOLu quZlQOaIzuG0X6ezs0wWEag17cw70y+VVjws4dgQXiAhezgQC2zalzP17UcMLuKPTuQs x95T1VfhC7FyACQwtvVW9KgWBAcHqND9FoIf9urwRyCpH1hqyLD/Z+bLu4+HRqzmP7ke vWHh5Z4ilxewiaQUYOoljVyL/xWIlSabOxs+LSbmRmZ7nPj/1jNK8ic0GDBxfzoOsDwc SCkPi1whik2wEUt+HVEJq3yHByBuUN9h+A1ER4FMjxGygh2qIX7aI0IVfojQK1CUVAlt 7amg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id t9si12282945plr.295.2019.06.18.04.54.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2019 04:54:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 629326E148; Tue, 18 Jun 2019 11:54:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by gabe.freedesktop.org (Postfix) with ESMTPS id F414F6E148 for ; Tue, 18 Jun 2019 11:54:52 +0000 (UTC) Received: by mail-lf1-x144.google.com with SMTP id y17so9069867lfe.0 for ; Tue, 18 Jun 2019 04:54:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+dfjBSHgtV2+DqYW/2qohoqP6tQvX9lvmbwlN9p8xok=; b=mI0evpzX9C4dh/vyhNHv41IYzN19Gb/z57avoPrKDiPVhjIfKAJyAUur+LQbB88ExR pC2GHi57M++yBFNruz/zjrvt8CRXOm19ggGRU4kN2wFmqQkQ7DLL+RhQ85LyjmHC/B0z M5fQ5B3D52CU5p0v2F608JRWQ+DjC+TIPXJrOcuGzIa5qfoHHHNk9puBIYOqJdIdti0g lcuC2IBCCQwW2TB3UNNbpdVnVAAAalETRxVhxvNKpz1SZzOeZe9Lp+jXUxT5VMHgdFw/ 7CIfmQlzIGUaK1TE+gSfZGpf7/rPOCeQ2Q9u0s/YRFShJM/1IXD9Eq0HHYOmqJpT1q45 cuaw== X-Gm-Message-State: APjAAAVGgM35ux93b4CeIETA+DDhGZsScg4eQ+zJ472A/8gmmo/cYcU7 Ec5ZG3IDYRXY5xx2NgC6I+i9MGJLYFQ= X-Received: by 2002:ac2:46f9:: with SMTP id q25mr6053748lfo.181.1560858891114; Tue, 18 Jun 2019 04:54:51 -0700 (PDT) Received: from localhost.localdomain (c-d2cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.210]) by smtp.gmail.com with ESMTPSA id v4sm2566603lji.103.2019.06.18.04.54.49 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 04:54:50 -0700 (PDT) From: Linus Walleij To: dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Sean Paul Subject: [PATCH v2] drm/mcde: Fix uninitialized variable Date: Tue, 18 Jun 2019 13:52:45 +0200 Message-Id: <20190618115245.13915-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+dfjBSHgtV2+DqYW/2qohoqP6tQvX9lvmbwlN9p8xok=; b=GpN5sTjv86uCDuTPWuHMOqFwziSbLRPXZRL+U9QzUSFvWALTXnq0efOqF63gANGgQw MaWtqZdL9LF5xjuPgOVXuR5WyFN0egV1FFRPlqhUkqqK6ytJfShboMrLgRShdXPkrA+p BXb8EWjOt2hf3CC1fhPokHWTYso+rdRmUzRHIRgkRtoYVVPUIleUUr9e0c/HFAq5ARGk HVAINiGpgs8BwU7R8hfTfxkvetZYVG1PDPNNLUr9AY8EMH7ARz42/G5HwfNZ8jM9iToO OgdMxvZljmTmSvoZfDqY0et5s5v5uhvTckUgCOqyNANon722ww4w6GPf5udX1HYNfu9P 3sCA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dan Carpenter , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We need to handle the case when of_drm_find_bridge() returns NULL. Reported-by: Dan Carpenter Cc: Dan Carpenter Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Account for both NULL and error pointers by two clauses. --- drivers/gpu/drm/mcde/mcde_drv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c index baf63fb6850a..a810568c76df 100644 --- a/drivers/gpu/drm/mcde/mcde_drv.c +++ b/drivers/gpu/drm/mcde/mcde_drv.c @@ -319,7 +319,7 @@ static int mcde_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct drm_device *drm; struct mcde *mcde; - struct component_match *match; + struct component_match *match = NULL; struct resource *res; u32 pid; u32 val; @@ -485,6 +485,10 @@ static int mcde_probe(struct platform_device *pdev) } put_device(p); } + if (!match) { + dev_err(dev, "no matching components\n"); + return -ENODEV; + } if (IS_ERR(match)) { dev_err(dev, "could not create component match\n"); ret = PTR_ERR(match);