Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp664388ybi; Wed, 19 Jun 2019 05:58:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXzYY5zMeQowv3Nik+j94A3zrW5iUzw4Xr4KW1cMvhrEXKRllZ+gIbV4grAAA5nVR78qGM X-Received: by 2002:a17:902:1e9:: with SMTP id b96mr73014827plb.277.1560949084890; Wed, 19 Jun 2019 05:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560949084; cv=none; d=google.com; s=arc-20160816; b=lAN1N1SCtCaCp0nTiM4l8LLYI9KSx/h/QaaL/TQWUDMOlzeeTKvO7xEd4fJCSlNM0E hFLgViJxUCANWTOvpOeECuAHmXq6djNMRocMNkaS8FuJzIPdHBbIQOJwrGK+rX2+V9QB sFa6kzQq1lT5vdWmeGtsFqmrhPv3askhVs9wzWNpdPczaM4774z6HhaLS/8uBtSSqdlQ cbTHkd40OcBfy/ok7XwEOVHIwz9ZGFhR2Em6F5wgTiDZx0AVh553ziOAxe2FeTgCHRVN zcV89r2RpMAmIAqbD/fZ4EXNoTwrehCdQ3UPnhNitR215DG8s3bqHA5yw32CKygnAEiX /VvA== 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 a15si3003114pgw.246.2019.06.19.05.57.50; Wed, 19 Jun 2019 05:58:04 -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 S1731757AbfFSM46 (ORCPT + 99 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 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:ZJwSOzQMuPp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el.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(+) 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); -- 2.20.0