.. | .. |
---|
488 | 488 | if (of_property_read_u32(child, "reg", &val)) { |
---|
489 | 489 | ret = mxs_pinctrl_parse_group(pdev, child, |
---|
490 | 490 | idxg++, NULL); |
---|
491 | | - if (ret) |
---|
| 491 | + if (ret) { |
---|
| 492 | + of_node_put(child); |
---|
492 | 493 | return ret; |
---|
| 494 | + } |
---|
493 | 495 | continue; |
---|
494 | 496 | } |
---|
495 | 497 | |
---|
.. | .. |
---|
499 | 501 | f->ngroups, |
---|
500 | 502 | sizeof(*f->groups), |
---|
501 | 503 | GFP_KERNEL); |
---|
502 | | - if (!f->groups) |
---|
| 504 | + if (!f->groups) { |
---|
| 505 | + of_node_put(child); |
---|
503 | 506 | return -ENOMEM; |
---|
| 507 | + } |
---|
504 | 508 | fn = child->name; |
---|
505 | 509 | i = 0; |
---|
506 | 510 | } |
---|
507 | 511 | ret = mxs_pinctrl_parse_group(pdev, child, idxg++, |
---|
508 | 512 | &f->groups[i++]); |
---|
509 | | - if (ret) |
---|
| 513 | + if (ret) { |
---|
| 514 | + of_node_put(child); |
---|
510 | 515 | return ret; |
---|
| 516 | + } |
---|
511 | 517 | } |
---|
512 | 518 | |
---|
513 | 519 | return 0; |
---|
.. | .. |
---|
556 | 562 | iounmap(d->base); |
---|
557 | 563 | return ret; |
---|
558 | 564 | } |
---|
559 | | -EXPORT_SYMBOL_GPL(mxs_pinctrl_probe); |
---|