From patchwork Wed Jun 19 12:56:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 167235 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp697532ilk; Wed, 19 Jun 2019 05:57:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxw6VJvqA0ocKgBArDVPtVwbENyOT0wgCkriHk2Jb57P7+HaYchsNpIgAnWGu7BZ8HIi9Kt X-Received: by 2002:aa7:8201:: with SMTP id k1mr1387513pfi.97.1560949020868; Wed, 19 Jun 2019 05:57:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560949020; cv=none; d=google.com; s=arc-20160816; b=OJMZsWXo8JZ3Admxf8TLTq+MOGcTNV+XE8ORoCmwk/mGfJRDZoxOnR4ZGTjpzme0Yd oJqdGjI3fY/GKKG03Mskj1VPUJ5wmh2DfojMihA4HiQc54X6TM9QQvwk4WQkpMzRlu82 bvLBvtE2GHrfBUsxHtVGa5JeQv5i+jlnFkpxc4KLcExDr014D9W1C9ASLEkcD5Xv0tFL b1Gm7rBy55QMwPlKcJvyxFxnZ0FlVtku1HDEKDGxRozK+EbNM8z433TkU4+KmwYG/5vO vBtSE88jWdbOgoS9GOhgqojbahS6x1+ANq0rUCnq007XGYLDPBtxVcP8kcmU7I5p++6b TJBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MJ5ms5KYPur2NOMlzwSmPcleoY1b8vrzKfdmAl5UMRQ=; b=a3lkADM1ZFcQthGyroKgWlM73hnFMgxnKeBA333G1y+JvJcZeQR4YjFrXZomaJyjm1 sPJ3N2FCqGhX1BosAFuAwZbMDJIFY0N7lcyLogE+C1l9bpajRphcXbzwvLMLkAJgPvfd 28E4BheVKr9FcUwpJdkY++AbsInO3cVQE/EZobXAGFoXd38nqKHDKIRLvAZg+14MFXer 2yp3hDW0EO1B/ivGfmdeoqkLSwnz0pvlcU4uf7QMjXiM0LRb1kKgmsLbdNSS/Fh7YIsi 30OAzGIbwd2QGo3af2i6oSuZQ1jy5m5cL0stC07qbXtLG9q/x0ry6q3D9S/NP1Dm75TR Cahw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si15130847pls.196.2019.06.19.05.57.00; Wed, 19 Jun 2019 05:57:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731815AbfFSM46 (ORCPT + 30 others); Wed, 19 Jun 2019 08:56:58 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:52583 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727244AbfFSM46 (ORCPT ); Wed, 19 Jun 2019 08:56:58 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1Md6dH-1iCdyW161r-00aBCA; Wed, 19 Jun 2019 14:56:39 +0200 From: Arnd Bergmann To: Joel Stanley Cc: Arnd Bergmann , Andrew Jeffery , Patrick Venture , Vijay Khemka , linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] soc: aspeed: fix probe error handling Date: Wed, 19 Jun 2019 14:56:23 +0200 Message-Id: <20190619125636.1109665-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:ZJwSOzQMuPpHsrU/+qvC0BE/4HBT6tcQ0i6nWWwdFMZI7Lp37LT EhDuHwiX9TgKYWtK3bytwlf9alSchNSd3HIu3+i2ShJqPpZF0IycKFhDZRLr5nSzcurUU8s TTlggu2/kKjAzmi0JMsgLMKJmUrck9PseSduRgPAZEBfkRhQNKngF+cstswdqnsCwYfUOtC DYfjeGhgOkWZQRKdeV1CA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:LGDpA5YzoUY=:XTDjw9epM4xTzibkdByj5K GhIoK1yF82OWjpMeOzQgnmeVnkx98/kU1pZTERJCdJi9xsYO1rzx9v4BHyw5hNVXMy/hoCMmg R8ZUvFbo6ALJY8qcu7O5sAM029mTaKymbN4tbNjRxpFH09r/9tst6rkT/62mTG1X0CaIHbqI3 3NDJMvWo9oGLsuysv9X4bzP9Ohdb1IPgcYF81bZjPJ5Jlvk7UR9kul0VZwkrWf0PoT+2fe4aH MJlMnX3rtqs4jmF0+rRuDvyuBggJN48PVLtQxln1U5D2RIpZ6Jab4MFQDQV7qEsJQDgreu4DZ yYsPkVE4zRFFgpoaHazeuL0hCbVHIuMe3osHNpKwDMmQV8PosE9SLcSWhVhM8PB7DqE1urHWI SeUA6A9vR3ajuhrYaJ9R/ggQqrQT/MwGZrOgQeoey0A8bRDrGMtRF9sJWkJzVs6lR+LBZ/Qd4 Fh42eJZWNZYEmS3P1g8BeedER3edpIzzMXbxCpf/UMTBgviowSsQJs7shQ/ziyd09yYR/tfun NuC+QPCKou2F9BahTgQTYa+LcqCyJPLax11e2Y4nfwrpWDSSbqzbA2bqqatWpKGYyvZOG0pJM YFfWa4oPOTxWvC+bVAjlmbmiRPXRbMGMKEBSUKU+GMW/9c5sWM81NlPtEdifftrsH1Wuyv9bv lJREE0KyXnqutSAdXz7DjuUmD/K9lGRQXfkts2x5y1NJ0jP3hWiVyFq05qQ/fhd2egAL4DpIm RZkS4jUol5xwipOEO5zrS9SItLbZ3JG+d4LH5g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc warns that a mising "flash" phandle node leads to undefined behavior later: drivers/soc/aspeed/aspeed-lpc-ctrl.c: In function 'aspeed_lpc_ctrl_probe': drivers/soc/aspeed/aspeed-lpc-ctrl.c:201:18: error: '*((void *)&resm+8)' may be used uninitialized in this function [-Werror=maybe-uninitialized] The device cannot work without this node, so just error out here. Signed-off-by: Arnd Bergmann --- drivers/soc/aspeed/aspeed-lpc-ctrl.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.0 diff --git a/drivers/soc/aspeed/aspeed-lpc-ctrl.c b/drivers/soc/aspeed/aspeed-lpc-ctrl.c index 239520bb207e..81109d22af6a 100644 --- a/drivers/soc/aspeed/aspeed-lpc-ctrl.c +++ b/drivers/soc/aspeed/aspeed-lpc-ctrl.c @@ -212,6 +212,7 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev) node = of_parse_phandle(dev->of_node, "flash", 0); if (!node) { dev_dbg(dev, "Didn't find host pnor flash node\n"); + return -ENXIO; } else { rc = of_address_to_resource(node, 1, &resm); of_node_put(node);