overlay_bad_add_dup_prop.dts (1126B)
1// SPDX-License-Identifier: GPL-2.0 2/dts-v1/; 3/plugin/; 4 5/* 6 * &electric_1/motor-1/electric and &spin_ctrl_1/electric are the same node: 7 * /testcase-data-2/substation@100/motor-1/electric 8 * 9 * Thus the property "rpm_avail" in each fragment will 10 * result in an attempt to update the same property twice. 11 * This will result in an error and the overlay apply 12 * will fail. 13 * 14 * The previous version of this test did not include the extra 15 * level of node 'electric'. That resulted in the 'rpm_avail' 16 * property being located in the pre-existing node 'motor-1'. 17 * Modifying a property results in a WARNING that a memory leak 18 * will occur if the overlay is removed. Since the overlay apply 19 * fails, the memory leak does actually occur, and kmemleak will 20 * further report the memory leak if CONFIG_DEBUG_KMEMLEAK is 21 * enabled. Adding the overlay node 'electric' avoids the 22 * memory leak and thus people who use kmemleak will not 23 * have to debug this non-problem again. 24 */ 25 26&electric_1 { 27 28 motor-1 { 29 electric { 30 rpm_avail = < 100 >; 31 }; 32 }; 33}; 34 35&spin_ctrl_1 { 36 electric { 37 rpm_avail = < 100 200 >; 38 }; 39};