Commit b65ce38
genetlink: clean up family attributes allocations
genl_family_rcv_msg_attrs_parse() and genl_family_rcv_msg_attrs_free()
take a boolean parameter to determine whether allocate/free the family
attrs. This is unnecessary as we can just check family->parallel_ops.
More importantly, callers would not need to worry about pairing these
parameters correctly after this patch.
And this fixes a memory leak, as after commit c36f055
("genetlink: fix memory leaks in genl_family_rcv_msg_dumpit()")
we call genl_family_rcv_msg_attrs_parse() for both parallel and
non-parallel cases.
Fixes: c36f055 ("genetlink: fix memory leaks in genl_family_rcv_msg_dumpit()")
Reported-by: Ido Schimmel <idosch@idosch.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 18dbd4c commit b65ce38
1 file changed
Lines changed: 12 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | | - | |
478 | | - | |
| 477 | + | |
479 | 478 | | |
480 | 479 | | |
481 | 480 | | |
| |||
486 | 485 | | |
487 | 486 | | |
488 | 487 | | |
489 | | - | |
| 488 | + | |
490 | 489 | | |
491 | 490 | | |
492 | 491 | | |
| |||
498 | 497 | | |
499 | 498 | | |
500 | 499 | | |
501 | | - | |
| 500 | + | |
502 | 501 | | |
503 | 502 | | |
504 | 503 | | |
505 | 504 | | |
506 | 505 | | |
507 | 506 | | |
508 | 507 | | |
509 | | - | |
510 | | - | |
| 508 | + | |
511 | 509 | | |
512 | | - | |
| 510 | + | |
513 | 511 | | |
514 | 512 | | |
515 | 513 | | |
| |||
537 | 535 | | |
538 | 536 | | |
539 | 537 | | |
540 | | - | |
541 | | - | |
| 538 | + | |
542 | 539 | | |
543 | 540 | | |
544 | 541 | | |
545 | 542 | | |
546 | 543 | | |
547 | 544 | | |
548 | | - | |
| 545 | + | |
549 | 546 | | |
550 | 547 | | |
551 | 548 | | |
| |||
562 | 559 | | |
563 | 560 | | |
564 | 561 | | |
565 | | - | |
| 562 | + | |
566 | 563 | | |
567 | 564 | | |
568 | 565 | | |
| |||
591 | 588 | | |
592 | 589 | | |
593 | 590 | | |
594 | | - | |
| 591 | + | |
595 | 592 | | |
596 | 593 | | |
597 | 594 | | |
| |||
604 | 601 | | |
605 | 602 | | |
606 | 603 | | |
607 | | - | |
| 604 | + | |
608 | 605 | | |
609 | 606 | | |
610 | 607 | | |
| |||
671 | 668 | | |
672 | 669 | | |
673 | 670 | | |
674 | | - | |
675 | | - | |
| 671 | + | |
676 | 672 | | |
677 | 673 | | |
678 | 674 | | |
| |||
698 | 694 | | |
699 | 695 | | |
700 | 696 | | |
701 | | - | |
| 697 | + | |
702 | 698 | | |
703 | 699 | | |
704 | 700 | | |
| |||
0 commit comments