Commit 80af374
of: dynamic: Fix use after free in of_changeset_add_prop_helper()
If the of_changeset_add_property() function call fails, then this code
frees "new_pp" and then dereference it on the next line. Return the
error code directly instead.
Fixes: c81f6ce ("of: dynamic: Fix memleak when of_pci_add_properties() failed")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/aKgljjhnpa4lVpdx@stanley.mountain
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>1 parent ac29e44 commit 80af374
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
938 | | - | |
| 938 | + | |
939 | 939 | | |
| 940 | + | |
| 941 | + | |
940 | 942 | | |
941 | 943 | | |
942 | 944 | | |
943 | 945 | | |
944 | | - | |
| 946 | + | |
945 | 947 | | |
946 | 948 | | |
947 | 949 | | |
| |||
0 commit comments