Message ID | 20210508220021.1778080-3-sjg@chromium.org |
---|---|
State | Changes Requested |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=eBfT8dRo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fd1Vm1r10z9tlN for <incoming@patchwork.ozlabs.org>; Sun, 9 May 2021 08:01:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8DC7E82EA5; Sun, 9 May 2021 00:01:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="eBfT8dRo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 02B6A82E78; Sun, 9 May 2021 00:00:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 60AC182E87 for <u-boot@lists.denx.de>; Sun, 9 May 2021 00:00:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd36.google.com with SMTP id p8so11266199iol.11 for <u-boot@lists.denx.de>; Sat, 08 May 2021 15:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GE/Wc/QZJJrmVRgs7tKKVx+KIGKmMyH93wLLvPVl++U=; b=eBfT8dRo3ShId4HJmEsyNBBveRg5ONTTT1HPG4YUqy8k5Pbgq1uBuyU9JfB7017bMO 8o1VH5s94DZRKTSZQaQ9luEQ+bqXF5qKkl66wt0j3JNmNDXd0N/0P3Tlrf0V+/2c0EQW IjEQfXb/q9k53FyOjOGO23X3xDAOPEdvNkF4A= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=GE/Wc/QZJJrmVRgs7tKKVx+KIGKmMyH93wLLvPVl++U=; b=KsHQHgSXuXRCY9OBkHzVk5/Hy8LGe9sZx9LB2DeFBRanEP1Rmbk0yogaBjCMqb0V5+ qxUiH9Kl7kVSN2cAkg6SbPuDIL9ADGesGxcu9ejxBwn1FHQUZNsxsq7jw1q/ewvA6QNo qUkWSTlzsDHjuUd+grPC3D7rhlFa7fx6lM9x3JJya4cunx1CDQHY30IaV/lsPocxtUPe Ga4Gr74EMB53h4aR031CPtKOioHMfVXBjreqWL3goVp+eO/Vlk/7gg74+Z3TG68xyJip W0Ynpfc64EDS3MIM0zUwMAjIius56FVVgDZvitkik6As/YrwcA9IEra8SjPgnCZbg8t6 rrwA== X-Gm-Message-State: AOAM531GVEf9wI5gGQu06dGDKfkAYO/u7n5nG1q11A3KQadnAZl5K5LT 3RtNeyD5nkNKphZv29LAZd/pf6t8k+rVcJDC X-Google-Smtp-Source: ABdhPJzC3nXpzS01yBhMAZwoeBpTCkLIWjpLPa8kOOfPKSIyfSvI6r7GLBsd1bsw3/W2AwUxXp55vQ== X-Received: by 2002:a02:9048:: with SMTP id y8mr14681039jaf.66.1620511228766; Sat, 08 May 2021 15:00:28 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t7sm5195196ile.87.2021.05.08.15.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 15:00:28 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>, Anatolij Gustschin <agust@denx.de> Subject: [PATCH 02/17] video: Check return value in pwm_backlight_of_to_plat() Date: Sat, 8 May 2021 16:00:06 -0600 Message-Id: <20210508220021.1778080-3-sjg@chromium.org> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog In-Reply-To: <20210508220021.1778080-1-sjg@chromium.org> References: <20210508220021.1778080-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean |
Series |
Fix various coverity warnings
|
expand
|
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c index 4c86215bd73..d7c096923b3 100644 --- a/drivers/video/pwm_backlight.c +++ b/drivers/video/pwm_backlight.c @@ -235,8 +235,10 @@ static int pwm_backlight_of_to_plat(struct udevice *dev) priv->levels = malloc(len); if (!priv->levels) return log_ret(-ENOMEM); - dev_read_u32_array(dev, "brightness-levels", priv->levels, - count); + ret = dev_read_u32_array(dev, "brightness-levels", priv->levels, + count); + if (ret) + return log_msg_ret("levels", ret); priv->num_levels = count; priv->default_level = priv->levels[index]; priv->max_level = priv->levels[count - 1];
This cannot actually fail, but check the value anyway to keep coverity happy. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 316351) --- drivers/video/pwm_backlight.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)