pinctrl: at91: use devm_kasprintf() to avoid potential leaks
[linux-2.6-block.git] / drivers / pinctrl / pinctrl-at91-pio4.c
index 39b233f73e13275b4b9c53d3f5a35e9696b92646..373eed8bc4be93db2a43069e015f6d208d8f6c88 100644 (file)
@@ -1149,8 +1149,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;