aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/of/unittest.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index cccde756b510..3832a5de4602 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -344,7 +344,7 @@ static void __init of_unittest_check_phandles(void)
344 } 344 }
345 345
346 nh = kzalloc(sizeof(*nh), GFP_KERNEL); 346 nh = kzalloc(sizeof(*nh), GFP_KERNEL);
347 if (WARN_ON(!nh)) 347 if (!nh)
348 return; 348 return;
349 349
350 nh->np = np; 350 nh->np = np;
@@ -1199,12 +1199,9 @@ static int __init unittest_data_add(void)
1199 1199
1200 /* creating copy */ 1200 /* creating copy */
1201 unittest_data = kmemdup(__dtb_testcases_begin, size, GFP_KERNEL); 1201 unittest_data = kmemdup(__dtb_testcases_begin, size, GFP_KERNEL);
1202 1202 if (!unittest_data)
1203 if (!unittest_data) {
1204 pr_warn("%s: Failed to allocate memory for unittest_data; "
1205 "not running tests\n", __func__);
1206 return -ENOMEM; 1203 return -ENOMEM;
1207 } 1204
1208 of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node); 1205 of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node);
1209 if (!unittest_data_node) { 1206 if (!unittest_data_node) {
1210 pr_warn("%s: No tree to attach; not running tests\n", __func__); 1207 pr_warn("%s: No tree to attach; not running tests\n", __func__);
@@ -1845,10 +1842,8 @@ static int unittest_i2c_bus_probe(struct platform_device *pdev)
1845 dev_dbg(dev, "%s for node @%pOF\n", __func__, np); 1842 dev_dbg(dev, "%s for node @%pOF\n", __func__, np);
1846 1843
1847 std = devm_kzalloc(dev, sizeof(*std), GFP_KERNEL); 1844 std = devm_kzalloc(dev, sizeof(*std), GFP_KERNEL);
1848 if (!std) { 1845 if (!std)
1849 dev_err(dev, "Failed to allocate unittest i2c data\n");
1850 return -ENOMEM; 1846 return -ENOMEM;
1851 }
1852 1847
1853 /* link them together */ 1848 /* link them together */
1854 std->pdev = pdev; 1849 std->pdev = pdev;