Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9127620pxu; Mon, 28 Dec 2020 07:17:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrIuCb4q3dvMeRrgFDMPzsWV0SIgpQuXZtJh3U1knEKDWUpFo1UTk1VLni9XOZJ5knzRXm X-Received: by 2002:a17:906:b287:: with SMTP id q7mr6208840ejz.311.1609168660923; Mon, 28 Dec 2020 07:17:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168660; cv=none; d=google.com; s=arc-20160816; b=mbz/a3BKpssvsSNy9nBjxQhugONu2RXQR4Xk18dIYigKdkXkkmqCaikOSGvJeIumub SCuM7PhTBdYDhoSZ2EjItERIgUryX0cxe+OCJ5erbipy5BXOxMXHG4sjykSzTDB3gut1 gEuNSeVGZKr2QtstM8f29GjKcbC0fINnl5gwMHkbK+RQpPOI+sAYLyWPYqf4BB893UuC bHJ3zzy5cvx6d3l6wbnwkg7QfRte0kSwTgBjfjfgoTHzuH7NwVtGaSKrMySnGcmw8UJk LS8lkDhqVCZf8Y3XCuWgUM7fHCKJA5vpnebV9CxVcbnAEv57GTSs0bCC5pHkqs37UlOY t3DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BfVhKfCyEhTxP/y5oHs6y6ggAvIuvtrIUA89OwcLHoQ=; b=Th84oSE2I2xN4QSZdVjS/szO++FSRrFxvLXlSw1tZGerZGCWU0CNvgu4Oaibo6/dgt aCc6SE17e5OW2p2RB1IHfAYstvP+fN0f0x9N1boSn463jSwNyOcspqyKfonblN5vHwzF B+5cyBfDtFgY0ymqINdeNjFhq0glOkwXoIu1qh8FpIfKA5CYbPh8yVWnqNOvtuoESG4S Lrh/Uxc8g+RzTbXMDidkriD5fYTRu6sFP6CU2BLiSOr2PPB/y5eRpG7FmoHZmj2NBw2/ 8w1X9wL0sm9AwYK0zxEO1s8zqjSBAJ1QUXmE5vpMEJwtLTYhWeB76u5/+DUlAf4U78aA 2tDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yEgkRbxn; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si20172149eds.331.2020.12.28.07.17.17; Mon, 28 Dec 2020 07:17:40 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=yEgkRbxn; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438216AbgL1OGs (ORCPT + 99 others); Mon, 28 Dec 2020 09:06:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:39074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437649AbgL1OFh (ORCPT ); Mon, 28 Dec 2020 09:05:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6F51D207AB; Mon, 28 Dec 2020 14:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164322; bh=wWXkFPlWy7IwQULWKRuo8ocxxowLRZN1TaKm+TUe2TM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yEgkRbxna2xdgIaUf/9XpeXiUaKmXr7kP8r36vv/a+hzdg6fr8TjvQJ/s9qKFKna1 YiV0rNszVd9xgh1m0YFLIR8A/mTd8gj3YX7Tx4Iy7nidPJOk3kQvB3Fdzv/WNct37E 3F90fZVkKteL/G617t8bs6RicNmg2inPdznrFCJQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yang Yingliang , Thomas Zimmermann , Sasha Levin Subject: [PATCH 5.10 138/717] video: fbdev: atmel_lcdfb: fix return error code in atmel_lcdfb_of_init() Date: Mon, 28 Dec 2020 13:42:16 +0100 Message-Id: <20201228125027.566652440@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yang Yingliang [ Upstream commit ba236455ee750270f33998df57f982433cea4d8e ] If devm_kzalloc() failed after the first time, atmel_lcdfb_of_init() can't return -ENOMEM, fix this by putting the error code in loop. Fixes: b985172b328a ("video: atmel_lcdfb: add device tree suport") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20201117061350.3453742-1-yangyingliang@huawei.com Signed-off-by: Sasha Levin --- drivers/video/fbdev/atmel_lcdfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index 8c1d47e52b1a6..355b6120dc4f0 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -987,8 +987,8 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) } INIT_LIST_HEAD(&pdata->pwr_gpios); - ret = -ENOMEM; for (i = 0; i < gpiod_count(dev, "atmel,power-control"); i++) { + ret = -ENOMEM; gpiod = devm_gpiod_get_index(dev, "atmel,power-control", i, GPIOD_ASIS); if (IS_ERR(gpiod)) -- 2.27.0