From nobody Wed Mar 16 00:10:27 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 64E021A2EDB8; Wed, 16 Mar 2022 00:10:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KJ9dv1pY6z4dtp; Wed, 16 Mar 2022 00:10:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647389427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sMkJjax4MzDFcmdpMep1MAe0fzG3VKnrRvpi8KnpWNg=; b=ZOFykYgKdSzrY520Ic2KJqEDSzo+ZveF15rNj4LY/KHojwwg5LasE3OLo2A1Dz59ijhuHt cap3Wg/7cIykbMi92b/yVuuKw30fbbUB5lwTqt3hWgpF9JvYbVbTUh5SehmChdgtOBm0d1 N7g5X5b61qzHQcLd4zEyEhJLokLzTcUAeW3hm92cgV26IAVxJ7yw47QHw0cOUYWzlV7nH+ aMNFczDsRygASE45or5OQ5hYsLuX4x/WhSOy24jN/n1zupiFtAF9l2dDLzVnXT35USPcXn dyAarquJBRcbpdrsJKQKN877YmAq2R7B4zUBF856d3qrkJ2kgoaoBVt0M2QF1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B76B3C93; Wed, 16 Mar 2022 00:10:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22G0AR2C056715; Wed, 16 Mar 2022 00:10:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22G0AR4x056714; Wed, 16 Mar 2022 00:10:27 GMT (envelope-from git) Date: Wed, 16 Mar 2022 00:10:27 GMT Message-Id: <202203160010.22G0AR4x056714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: d7661890efd2 - main - gpiopower: Fix failure case for attach List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7661890efd2d921f248724a1708d1e77bdb2625 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647389427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sMkJjax4MzDFcmdpMep1MAe0fzG3VKnrRvpi8KnpWNg=; b=ahRGJVuilK8+Kc0FFGX7zysdHfkHz6ZrGdo50j50UjFsyu/e+lG2G3tKMrKZqIpz+hbTAI aTYAI3IMWJ8YEy+0dDNbQshMax91Tg0fYuxfCaDeJePaHDiOMIGbNwNt0NMr2QP7HytbjR 7nd3CqkrWelVJrK5AorUZs8SjslxUuC/z5MKTtrh6leFjOSOy0pWmrlzEshV2f9iqI16E5 WB71EmNnSuvz4NxM/1BnbLmM76pWIgUfrn1PUV/TRAmnD7ixFZisggvniOAS0h8ib03sTW +E1YsJY+yXRH8hpXr54cYlcsBQ9IwnCVyOB16uvBjmls3JDEWkq/bzY5GfD0FQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647389427; a=rsa-sha256; cv=none; b=NCIpnylSG1unBQuve2gFuFzjU6arc3rsKQPcMvQ6R7QoRy7epFz2U53H6vvMdurQ/46Z7B azAAh8KIEsP7FsLNd8fUy+JdSxSrkxphL8XRTRcjTD12aCId84SAnO4zQdOKU33wk/5T+i 18nXbCxw/PBvG2S5zFCmAzq6aGrPbdYbo2I5xKjhrGMzkNR/7jd5QdGwwaXilLHIyYASKV NtVuugiUWZ9bdzoVUICjmKvEGw/UzVcL7VUBtwEia60g2fG2ZwQuZw3ePbiejC+zsCgQ6S GscpeE1EQv61gaTjTpbuPOQ3whtEaH3yo1cUp1vBzdqXd/litirVKy0ee5DFeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=d7661890efd2d921f248724a1708d1e77bdb2625 commit d7661890efd2d921f248724a1708d1e77bdb2625 Author: Justin Hibbits AuthorDate: 2022-03-15 18:40:48 +0000 Commit: Justin Hibbits CommitDate: 2022-03-16 00:16:17 +0000 gpiopower: Fix failure case for attach Summary: We really should be checking the return value of ofw_gpiobus_parse_gpios_impl, not the value of sc_pins, which isn't changed on failure. Reported by: alfredo@ Reviewers: #powerpc, alfredo Reviewed By: #powerpc, alfredo Subscribers: imp, loos Differential Revision: https://reviews.freebsd.org/D34571 --- sys/dev/gpio/gpiopower.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/gpio/gpiopower.c b/sys/dev/gpio/gpiopower.c index 98b635e3fd2a..3dcd489ed2fb 100644 --- a/sys/dev/gpio/gpiopower.c +++ b/sys/dev/gpio/gpiopower.c @@ -74,8 +74,7 @@ gpiopower_attach(device_t dev) if ((node = ofw_bus_get_node(dev)) == -1) return (ENXIO); - ofw_gpiobus_parse_gpios(dev, "gpios", &sc->sc_pin); - if (sc->sc_pin == NULL) { + if (ofw_gpiobus_parse_gpios(dev, "gpios", &sc->sc_pin) != 0) { device_printf(dev, "failed to map GPIO pin\n"); return (ENXIO); }