Skip to content

Commit 3609fa9

Browse files
committed
Merge tag 'devicetree-fixes-for-6.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree fixes from Rob Herring: - Fix an error path memory leak in DT unittest - Update Saravana's bouncing email * tag 'devicetree-fixes-for-6.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: of: unittest: Fix memory leak in unittest_data_add() MAINTAINERS: Update Saravana Kannan's email address
2 parents 9ace475 + 235a1eb commit 3609fa9

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,8 @@ Sankeerth Billakanti <[email protected]> <[email protected]>
705705
Santosh Shilimkar <[email protected]>
706706
Santosh Shilimkar <[email protected]>
707707
Sarangdhar Joshi <[email protected]>
708+
709+
708710
Sascha Hauer <[email protected]>
709711
710712
Sathishkumar Muruganandam <[email protected]> <[email protected]>

MAINTAINERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6532,7 +6532,7 @@ F: rust/kernel/cpufreq.rs
65326532
F: tools/testing/selftests/cpufreq/
65336533

65346534
CPU FREQUENCY DRIVERS - VIRTUAL MACHINE CPUFREQ
6535-
M: Saravana Kannan <saravanak@google.com>
6535+
M: Saravana Kannan <saravanak@kernel.org>
65366536
65376537
S: Maintained
65386538
F: drivers/cpufreq/virtual-cpufreq.c
@@ -7170,7 +7170,7 @@ F: drivers/base/devcoredump.c
71707170
F: include/linux/devcoredump.h
71717171

71727172
DEVICE DEPENDENCY HELPER SCRIPT
7173-
M: Saravana Kannan <saravanak@google.com>
7173+
M: Saravana Kannan <saravanak@kernel.org>
71747174
71757175
S: Maintained
71767176
F: scripts/dev-needs.sh
@@ -19547,7 +19547,7 @@ F: include/linux/oa_tc6.h
1954719547

1954819548
OPEN FIRMWARE AND FLATTENED DEVICE TREE
1954919549
M: Rob Herring <[email protected]>
19550-
M: Saravana Kannan <saravanak@google.com>
19550+
M: Saravana Kannan <saravanak@kernel.org>
1955119551
1955219552
S: Maintained
1955319553
Q: http://patchwork.kernel.org/project/devicetree/list/

drivers/of/unittest.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,6 @@ static void attach_node_and_children(struct device_node *np)
19851985
*/
19861986
static int __init unittest_data_add(void)
19871987
{
1988-
void *unittest_data;
19891988
void *unittest_data_align;
19901989
struct device_node *unittest_data_node = NULL, *np;
19911990
/*
@@ -2004,7 +2003,7 @@ static int __init unittest_data_add(void)
20042003
}
20052004

20062005
/* creating copy */
2007-
unittest_data = kmalloc(size + FDT_ALIGN_SIZE, GFP_KERNEL);
2006+
void *unittest_data __free(kfree) = kmalloc(size + FDT_ALIGN_SIZE, GFP_KERNEL);
20082007
if (!unittest_data)
20092008
return -ENOMEM;
20102009

@@ -2014,12 +2013,10 @@ static int __init unittest_data_add(void)
20142013
ret = of_fdt_unflatten_tree(unittest_data_align, NULL, &unittest_data_node);
20152014
if (!ret) {
20162015
pr_warn("%s: unflatten testcases tree failed\n", __func__);
2017-
kfree(unittest_data);
20182016
return -ENODATA;
20192017
}
20202018
if (!unittest_data_node) {
20212019
pr_warn("%s: testcases tree is empty\n", __func__);
2022-
kfree(unittest_data);
20232020
return -ENODATA;
20242021
}
20252022

@@ -2038,7 +2035,6 @@ static int __init unittest_data_add(void)
20382035
/* attach the sub-tree to live tree */
20392036
if (!of_root) {
20402037
pr_warn("%s: no live tree to attach sub-tree\n", __func__);
2041-
kfree(unittest_data);
20422038
rc = -ENODEV;
20432039
goto unlock;
20442040
}
@@ -2059,6 +2055,8 @@ static int __init unittest_data_add(void)
20592055
EXPECT_END(KERN_INFO,
20602056
"Duplicate name in testcase-data, renamed to \"duplicate-name#1\"");
20612057

2058+
retain_and_null_ptr(unittest_data);
2059+
20622060
unlock:
20632061
of_overlay_mutex_unlock();
20642062

0 commit comments

Comments
 (0)