From patchwork Wed Dec 22 21:28:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 12697323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2CB5C433F5 for ; Wed, 22 Dec 2021 21:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=w6jkmj5Br6tjP1R/FydNimamDOZQVv1EQspGyvFwP1o=; b=JdJ+1ZaxQ7BzR0 kY3c9J2PCnjYmv7WEqq+liNBP5uY9zF9Lt66Rbg8n+xoLwTGXLGHZJ419qni+LqD4yFXdhVy0dDkN IkdfCLXjp9uSRk8/t6x3cFHKQdQ2cABPe9c4StCP8DUVrUxwzJqKqXGkhOI15byUbdwhc2zf+ZfT2 cDdI7QHqVU5YbuelSt8AERA08JbSWBFxncxKDTkZtgdcUIj3anSVRIhLVw+lztI5PGjPMR0Nwcg3l aTReEVwEdjvGUYH7EUGUsffWkH1hoVWihbRrHKgUBUntm5CAZSDKrjBIbPQv6AZV9OooIEnERwmy8 2X/Du52KIDkgSAmyHS6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n099z-00BLEx-G4; Wed, 22 Dec 2021 21:28:31 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n099w-00BLEb-C0 for linux-arm-kernel@lists.infradead.org; Wed, 22 Dec 2021 21:28:29 +0000 Received: by mail-lj1-x22f.google.com with SMTP id z8so5800601ljz.9 for ; Wed, 22 Dec 2021 13:28:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dGdI8QtbU0WUh2YDCEexSXRgsm3VPR2+FtVmusVlaPI=; b=Ht+0/oGmG81OCKPiuE70yuoqRTiWE+qP2jT3xtAukrKMvmmDf3Dy4nx951o47PUY+g 0Z4FqywqsuM7enl6EXVFLpBbGwoiI+F+cboci9VBj6Oh5xITWXdJVHWVgTF6+Vblv6XZ QGd2xHilpdEUjLdliI4qppnnWP5FM2O68N72EohczeqCmPklO73d1WXff5Tw+myD5x6A 50ol/GoPGRHVIgHdN9uzw79SGru1hA3V83yIfvt4RZwRRgln0uMz+/6NBb7JBClXwrXv GpytFkRJmwoQk2K6ptkoDVRSw19XTWSE6c2lf8eXemLcbDVQUedIPlXkPFQr7hFkVZh5 ztNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dGdI8QtbU0WUh2YDCEexSXRgsm3VPR2+FtVmusVlaPI=; b=lCaKpZue+7nBXtd6xD3FUNUOdAZWb8U12KqDVNKnX4+gKh4NpZEAM5Ndzsfs2cCO+O uYNrhz2HGB/ciIqK3f8FEJfEgwKEDdvi/PvZOH49eN93Vrwkj/H0ZVWtxRIV+1d6TMP4 dD+SgDmuxM21AvhW5+DyQoEHBYmPExNXymDZ+M/n4XCguu15Y/xMeKmrIc5+W1N+tqkZ ZL2qw/fslxqI56NIExg8NGAD5KK0r1P6BCDMNw7JhQHmbbn/NmfUOnjd+blu13Ri4g6Y Wbq0SKJUe8ZAeqk0Jl3s+ULTUQXS80Iqgid/LgG7ox86IRWcZQoqc6HBvF1hfSvqmNdH VVlw== X-Gm-Message-State: AOAM533jvq5+TOKrXxSDpUBko1iC8AvOVtPBal+dm0gibHE4Vfc3FGU5 z/EVhFk31GnwprmLlI+1sDg= X-Google-Smtp-Source: ABdhPJzpYuCe/stuodM78DJuGM4howH7gd3A1SP8vswfiw8F7MmUg+dsql+AdjdtlHfvD1oLlWKJZQ== X-Received: by 2002:a2e:2e0e:: with SMTP id u14mr3284766lju.28.1640208506647; Wed, 22 Dec 2021 13:28:26 -0800 (PST) Received: from localhost.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id f1sm318758lfg.89.2021.12.22.13.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Dec 2021 13:28:26 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: Linus Walleij Cc: Dong Aisheng , Fabio Estevam , Shawn Guo , Stefan Agner , Pengutronix Kernel Team , Sascha Hauer , NXP Linux Team , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Abel Vesa Subject: [PATCH] pinctrl: imx: fix allocation result check Date: Wed, 22 Dec 2021 22:28:07 +0100 Message-Id: <20211222212807.27122-1-zajec5@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_132828_437014_09671040 X-CRM114-Status: GOOD ( 13.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Rafał Miłecki Fix code to check correct variable value. Reported-by: Abel Vesa Fixes: 02f117134952 ("pinctrl: imx: prepare for making "group_names" in "function_desc" const") Signed-off-by: Rafał Miłecki Reviewed-by: Abel Vesa --- Linus: I'm not sure if you can rebase your tree. Treat it as separated patch or fixup. Depending on how to manage your repository. --- drivers/pinctrl/freescale/pinctrl-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 47b2ab1a14d0..16bc1bfc03e4 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -667,7 +667,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np, group_names = devm_kcalloc(ipctl->dev, func->num_group_names, sizeof(char *), GFP_KERNEL); - if (!func->group_names) + if (!group_names) return -ENOMEM; for_each_child_of_node(np, child) group_names[i] = child->name;