From patchwork Thu May 5 20:10:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9027181 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A5AA29F1D3 for ; Thu, 5 May 2016 20:11:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D272F203C3 for ; Thu, 5 May 2016 20:11:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0B407203B5 for ; Thu, 5 May 2016 20:11:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BCBC6EA1C; Thu, 5 May 2016 20:11:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71E4B6EA1C for ; Thu, 5 May 2016 20:11:14 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LkhLo-1bYZmG3H1Q-00aSWS; Thu, 05 May 2016 22:11:04 +0200 From: Arnd Bergmann To: Maxime Ripard , David Airlie , Chen-Yu Tsai Subject: [PATCH] drm: sun4i: fix probe error handling Date: Thu, 5 May 2016 22:10:52 +0200 Message-Id: <1462479061-893414-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:/aZtnwJW0bKQwx6/Ob37vkYXEyeKvug49U5aJ8xS3Myt94427Un adClPNVv5q3VkcBy29kx5/7RuqHfLLaNqpBBX0v3mD+2UKlID1jpoSVoVf8UlvaL4gdYljg ugkC6jKsCfPv6G+axb/nHQN6JEqJR0dSrI+t1wShmDpqoacqhxQveR2SrVLv4/CgOWc85VT n6H0s0k6eawlF3WL5n9wA== X-UI-Out-Filterresults: notjunk:1; V01:K0:KhgaPc48lEc=:9ZnNEoi/x3A27lISsk988i H0a1gvH6+dCTLB/kdr97qyih+iThwSPznjsEAOS+CK8V/af6OYv3/6xncbqrfpfG/2JhCZc6E z4scAStre0PLgLMmuZBNoHxFAWYxqKXKvPyvwogLiZ5iM7GxsijgUm0NkqaFN4DPne3GTwC9q VZXHupIoRxQHoPSHPDwl+R2NH3grk6YKTqrnaQUt5ahDbHLFwKRFDE92OzVZTizD0FWhQ7nb3 XTRoqmQVQ0v+l9dSYWEdPGF+MPDnRQcTE5Y9I1IK3/am0u7lMl1XAzIDrIzUQcw6rRAikFHHI /7cnPrwwGmunUOMmRoUv2AuMjH6i8zrhlsS7lZ7cP/aTAbvNgV4Ef6Hmk/us3/VUUvhQ6i8IG ijDtn+XTrmkjl3iv9le1RsJgAFszSuZnmAwAM5CsL8F+ZQMVevKJGf0oxi64JWuBCSJa9EXh1 RFpS/jdE252x9TQR4KX+vNCPRTRecA5aOBmzQDdx9aQN46peDeLQ3vxHt8RQoVtCzimDtRiPm 0QmLWtjU3u8+DQkuMCpuuIwoCvMsnM55dS1fp2nFjGfO7ugptUCbdXFKlJ8c5ydXzfKkj+RR/ 4lBwLzUI1Hfxj50PtFWSBYlXShlftC527o0Rg77h9hRB1lm3GnNl4EmlZadj4uz/X2FBUDk6K e0HywO69VWRmkipJiuU0PoDlY+5vWnfk1tU1b2hlLTxG4WcP3hxMRbkBvqjOGMZPhWwU= Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Arnd Bergmann , linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP gcc points out a possible uninitialized variable use in sun4i_dclk_create(): drivers/gpu/drm/sun4i/sun4i_dotclock.c: In function 'sun4i_dclk_create': drivers/gpu/drm/sun4i/sun4i_dotclock.c:139:12: error: 'clk_name' may be used uninitialized in this function [-Werror=maybe-uninitialized] init.name = clk_name; The warning only shows up when CONFIG_OF is disabled, and the property is never filled, but the same bug can show up even when CONFIG_OF is enabled but of_property_read_string_index returns another error. To fix it, this ensures that sun4i_dclk_create propagates any error from of_property_read_string_index. Signed-off-by: Arnd Bergmann Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") --- drivers/gpu/drm/sun4i/sun4i_dotclock.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c index 3ff668cb463c..6c9c090a8006 100644 --- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c +++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c @@ -127,10 +127,14 @@ int sun4i_dclk_create(struct device *dev, struct sun4i_tcon *tcon) const char *clk_name, *parent_name; struct clk_init_data init; struct sun4i_dclk *dclk; + int ret; parent_name = __clk_get_name(tcon->sclk0); - of_property_read_string_index(dev->of_node, "clock-output-names", 0, - &clk_name); + ret = of_property_read_string_index(dev->of_node, + "clock-output-names", 0, + &clk_name); + if (ret) + return ret; dclk = devm_kzalloc(dev, sizeof(*dclk), GFP_KERNEL); if (!dclk)