Skip to content

Commit 1c4e5c4

Browse files
claudiubeznealinusw
authored andcommitted
pinctrl: at91: use devm_kasprintf() to avoid potential leaks
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 4b6b185 commit 1c4e5c4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/pinctrl/pinctrl-at91-pio4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,8 @@ static int atmel_pinctrl_probe(struct platform_device *pdev)
11491149

11501150
pin_desc[i].number = i;
11511151
/* Pin naming convention: P(bank_name)(bank_pin_number). */
1152-
pin_desc[i].name = kasprintf(GFP_KERNEL, "P%c%d",
1153-
bank + 'A', line);
1152+
pin_desc[i].name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "P%c%d",
1153+
bank + 'A', line);
11541154

11551155
group->name = group_names[i] = pin_desc[i].name;
11561156
group->pin = pin_desc[i].number;

drivers/pinctrl/pinctrl-at91.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1875,7 +1875,7 @@ static int at91_gpio_probe(struct platform_device *pdev)
18751875
}
18761876

18771877
for (i = 0; i < chip->ngpio; i++)
1878-
names[i] = kasprintf(GFP_KERNEL, "pio%c%d", alias_idx + 'A', i);
1878+
names[i] = devm_kasprintf(&pdev->dev, GFP_KERNEL, "pio%c%d", alias_idx + 'A', i);
18791879

18801880
chip->names = (const char *const *)names;
18811881

0 commit comments

Comments
 (0)