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 909C4C7EE23 for ; Mon, 27 Feb 2023 02:08:36 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vAboUQTK8L63vM9uJUQ+XLL157YSPkqu+Vvp0G/TqKI=; b=eurEXxobQddbQ5 Cd2ce/tQr2gYe/4vXQfkmrWvXWnvASfoc5gkzBHTXnOGvOUi/9gPdff1hNrIgcKsRdUT8gzCUtfKW CwvBFrbOmMNR2Uh/ElimHDNlO3J73VVP/H3BN3fctUruhWlw+rfH1y71MrzQbfFouAo4y5BYKtAUj xqNvr61O17oFtlcWJNFJppKjxh9+i5XG4t9AKoQHFAFbD/WVZd1hADm9yMJCdELs57umlk/A3WusU F3CnQWr7yMHRm2qyROkCgVqPYUZzDT8JkHJIiqHhlmbfRUJaHqi7knvYvjCS5wS9s8ZfnNT0OLW8X MGMAJutBhmQl8W9J1Wig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pWSvS-008Cyp-P0; Mon, 27 Feb 2023 02:07:38 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pWSvP-008CyF-0k for linux-arm-kernel@lists.infradead.org; Mon, 27 Feb 2023 02:07:36 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 983D1B80CB7; Mon, 27 Feb 2023 02:07:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C259C433AA; Mon, 27 Feb 2023 02:07:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677463653; bh=9fFmLIjyGzvoCvdtVc65Ti5AHUAr+vsnbtdd5jhjFbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VHtI21vS3qm7O+KmydBY6fXQh09A9wTWnNkDnULluQeXSWvJUjJmw4L+fJMLXa2dU TcYMM0YU2OnUw+a0ac4fclgzD0yd2+CY97ZbmdukfUjKs1QyWWOt+TBbbWOnScXVaM QeKL5MFjOihTo7rTUtJ2vKUJW27I2CuQcjNryiV2IytnNXqtKozWiwrq3KfYMPnmow 7ctlZwBxlYe8L1XWSa1h7+rvF7z+TrxdsT/888HvWT5VOfKFOn+N5mVeJqAJMP3eH7 RtYlG/2t63Xu61rpPh9MjurB4UBylEj3Je0bVZR8AXnH0iGvQc3xGiOB/IhMvXmybc v8Eymfh4mu1ZA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 43/58] pinctrl: at91: use devm_kasprintf() to avoid potential leaks Date: Sun, 26 Feb 2023 21:04:41 -0500 Message-Id: <20230227020457.1048737-43-sashal@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230227020457.1048737-1-sashal@kernel.org> References: <20230227020457.1048737-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230226_180735_231017_66652795 X-CRM114-Status: GOOD ( 14.26 ) 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: , Cc: Sasha Levin , alexandre.belloni@bootlin.com, Linus Walleij , linux-gpio@vger.kernel.org, ludovic.desroches@microchip.com, Claudiu Beznea , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Claudiu Beznea [ Upstream commit 1c4e5c470a56f7f7c649c0c70e603abc1eab15c4 ] Use devm_kasprintf() instead of kasprintf() to avoid any potential leaks. At the moment drivers have no remove functionality thus there is no need for fixes tag. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230203132714.1931596-1-claudiu.beznea@microchip.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-at91-pio4.c | 4 ++-- drivers/pinctrl/pinctrl-at91.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 82b921fd630d5..7f193f2b1566a 100644 --- a/drivers/pinctrl/pinctrl-at91-pio4.c +++ b/drivers/pinctrl/pinctrl-at91-pio4.c @@ -1120,8 +1120,8 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) pin_desc[i].number = i; /* Pin naming convention: P(bank_name)(bank_pin_number). */ - pin_desc[i].name = kasprintf(GFP_KERNEL, "P%c%d", - bank + 'A', line); + pin_desc[i].name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "P%c%d", + bank + 'A', line); group->name = group_names[i] = pin_desc[i].name; group->pin = pin_desc[i].number; diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 81dbffab621fb..ff3b6a8a0b170 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -1883,7 +1883,7 @@ static int at91_gpio_probe(struct platform_device *pdev) } for (i = 0; i < chip->ngpio; i++) - names[i] = kasprintf(GFP_KERNEL, "pio%c%d", alias_idx + 'A', i); + names[i] = devm_kasprintf(&pdev->dev, GFP_KERNEL, "pio%c%d", alias_idx + 'A', i); chip->names = (const char *const *)names; -- 2.39.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel