pinctrl: at91-pio4: check return value of devm_kasprintf()
[linux-2.6-block.git] / drivers / pinctrl / pinctrl-at91-pio4.c
index d402ac4b10db9e8f8670bac3ff681d78c31ebe21..5d360ba3abc2ec03e6a5d87f6e72af37866b8945 100644 (file)
@@ -1153,6 +1153,8 @@ static int atmel_pinctrl_probe(struct platform_device *pdev)
                /* Pin naming convention: P(bank_name)(bank_pin_number). */
                pin_desc[i].name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "P%c%u",
                                                  bank + 'A', line);
+               if (!pin_desc[i].name)
+                       return -ENOMEM;
 
                group->name = group_names[i] = pin_desc[i].name;
                group->pin = pin_desc[i].number;