From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F5D5309DDB; Mon, 13 Oct 2025 15:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760368652; cv=none; b=J49eqOuuLMc4qC6mF30jprQyY09AHYG3BIvwuIYia1cSULiLumKCvSCPWEM+MbpjS/MaoP9MHmQrCoFnMWtS+ssGtM1VB3v9Kjfu8ZseDqN29m0A6aQ+uFzvglBzhfQuTt49jPdkaCGGMajGssuqQgPYGse45axKeuEhOOCzzoE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760368652; c=relaxed/simple; bh=Oe/4ipeL1qKLTfyRUdy7OeJ2pN2E5BYpoB88YH+SY5M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MEMUpNQLz0xFVYpfibpjN0DQZkVK/yDefJf4VBG3QqKg7f08IInUCFlrx6Yq6KCDB0sGxgHPQwrASnAEk5Jf4dZ3Gy0vjVDCZA6NUqxqQoFquCmiTGC0X4sveYk6V5CaBkQVG8PL3Kw5kvJrNa/yBpsi+aZ8OjtQ00M6voq+cgc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rU34jCZZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rU34jCZZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1C2FC113D0; Mon, 13 Oct 2025 15:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760368652; bh=Oe/4ipeL1qKLTfyRUdy7OeJ2pN2E5BYpoB88YH+SY5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rU34jCZZUzyE7ys1y/12mMx9Uv8CUnmlUhrqJDq+1PhUByBuqG0qnTRpf4F+PS8aY Kv2KN0fHfeYMcQi1Gfp85BGxxp/CTwI44srHLDjw269ANDfnTYaCRA/DaxY4ioM4kj ROc8H/tbDfmCrHFqrV0RhCwB9g8mnXlhUiH+Bfp4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bartosz Golaszewski , Linus Walleij , Lee Jones Subject: [PATCH 6.12 235/262] mfd: vexpress-sysreg: Check the return value of devm_gpiochip_add_data() Date: Mon, 13 Oct 2025 16:46:17 +0200 Message-ID: <20251013144334.703208258@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251013144326.116493600@linuxfoundation.org> References: <20251013144326.116493600@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bartosz Golaszewski commit 1efbee6852f1ff698a9981bd731308dd027189fb upstream. Commit 974cc7b93441 ("mfd: vexpress: Define the device as MFD cells") removed the return value check from the call to gpiochip_add_data() (or rather gpiochip_add() back then and later converted to devres) with no explanation. This function however can still fail, so check the return value and bail-out if it does. Cc: stable@vger.kernel.org Fixes: 974cc7b93441 ("mfd: vexpress: Define the device as MFD cells") Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20250811-gpio-mmio-mfd-conv-v1-1-68c5c958cf80@linaro.org Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman --- drivers/mfd/vexpress-sysreg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/mfd/vexpress-sysreg.c +++ b/drivers/mfd/vexpress-sysreg.c @@ -90,6 +90,7 @@ static int vexpress_sysreg_probe(struct struct resource *mem; void __iomem *base; struct gpio_chip *mmc_gpio_chip; + int ret; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) @@ -110,7 +111,10 @@ static int vexpress_sysreg_probe(struct bgpio_init(mmc_gpio_chip, &pdev->dev, 0x4, base + SYS_MCI, NULL, NULL, NULL, NULL, 0); mmc_gpio_chip->ngpio = 2; - devm_gpiochip_add_data(&pdev->dev, mmc_gpio_chip, NULL); + + ret = devm_gpiochip_add_data(&pdev->dev, mmc_gpio_chip, NULL); + if (ret) + return ret; return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, vexpress_sysreg_cells,