Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 718ce68b authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Greg Kroah-Hartman
Browse files

pinctrl: at91: use devm_kasprintf() to avoid potential leaks



[ 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: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230203132714.1931596-1-claudiu.beznea@microchip.com


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 40003846
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1011,7 +1011,7 @@ 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",
		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;
+1 −1
Original line number Diff line number Diff line
@@ -1891,7 +1891,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;