Commit cbdef31
committed
of: unittest: Fix compile in the non-dynamic case
JIRA: https://issues.redhat.com/browse/RHEL-37072
CVE: CVE-2023-52679
commit 607aad1
Author: Christian A. Ehrhardt <lk@c--e.de>
Date: Mon Jan 29 20:25:56 2024 +0100
of: unittest: Fix compile in the non-dynamic case
If CONFIG_OF_KOBJ is not set, a device_node does not contain a
kobj and attempts to access the embedded kobj via kref_read break
the compile.
Replace affected kref_read calls with a macro that reads the
refcount if it exists and returns 1 if there is no embedded kobj.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401291740.VP219WIz-lkp@intel.com/
Fixes: 4dde835 ("of: Fix double free in of_parse_phandle_with_args_map")
Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
Link: https://lore.kernel.org/r/20240129192556.403271-1-lk@c--e.de
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Steve Best <sbest@redhat.com>1 parent de737bb commit cbdef31
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
| |||
562 | 568 | | |
563 | 569 | | |
564 | 570 | | |
565 | | - | |
| 571 | + | |
566 | 572 | | |
567 | 573 | | |
568 | 574 | | |
| |||
685 | 691 | | |
686 | 692 | | |
687 | 693 | | |
688 | | - | |
| 694 | + | |
689 | 695 | | |
690 | | - | |
| 696 | + | |
691 | 697 | | |
692 | 698 | | |
693 | 699 | | |
| |||
0 commit comments