Commit 981368e
platform/x86: hp-bioscfg: Fix reference leak
If a duplicate attribute is found using kset_find_obj(), a reference
to that attribute is returned which needs to be disposed accordingly
using kobject_put(). Use kobject_put() to dispose the duplicate
attribute in such a case.
As a side note, a very similar bug was fixed in
commit 7295a99 ("platform/x86: dell-sysman: Fix reference leak"),
so it seems that the bug was copied from that driver.
Compile-tested only.
Fixes: a34fc32 ("platform/x86: hp-bioscfg: bioscfg")
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com>
Link: https://lore.kernel.org/r/20230925142819.74525-3-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>1 parent 528ab3e commit 981368e
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
659 | 659 | | |
660 | 660 | | |
661 | 661 | | |
662 | | - | |
| 662 | + | |
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
| 707 | + | |
| 708 | + | |
708 | 709 | | |
| 710 | + | |
| 711 | + | |
709 | 712 | | |
710 | 713 | | |
711 | 714 | | |
| |||
768 | 771 | | |
769 | 772 | | |
770 | 773 | | |
771 | | - | |
| 774 | + | |
772 | 775 | | |
773 | 776 | | |
774 | 777 | | |
| |||
794 | 797 | | |
795 | 798 | | |
796 | 799 | | |
797 | | - | |
| 800 | + | |
| 801 | + | |
798 | 802 | | |
| 803 | + | |
| 804 | + | |
799 | 805 | | |
800 | 806 | | |
801 | 807 | | |
| |||
0 commit comments