Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423826AbdD1EcJ (ORCPT ); Fri, 28 Apr 2017 00:32:09 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35429 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164489AbdD1Eb6 (ORCPT ); Fri, 28 Apr 2017 00:31:58 -0400 From: frowand.list@gmail.com To: Rob Herring , stephen.boyd@linaro.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] of: unittest, fix possible use of unitialized variable Date: Thu, 27 Apr 2017 21:31:13 -0700 Message-Id: <1493353873-24246-1-git-send-email-frowand.list@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 815 Lines: 25 From: Frank Rowand Fix problem reported in the linux-next build. last_sibling may be unitialized in of_unittest() if the device tree is empty. Signed-off-by: Frank Rowand --- drivers/of/unittest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 12597ff8cfb0..8f14a43f48e5 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -2119,7 +2119,7 @@ static int __init overlay_data_add(int onum) */ static __init void of_unittest_overlay_high_level(void) { - struct device_node *last_sibling; + struct device_node *last_sibling = NULL; struct device_node *np; struct device_node *of_symbols; struct device_node *overlay_base_symbols; -- Frank Rowand