pstore/ram: Make initialization check as first one
A message that is not in the archive (sent off-list or not yet received): [email protected]
Kees Cook
AppliedQuoted 52 lines · Yue Hu
From
4320c0fcb5d685c8099937abce88e0b7fbbfe8dcMon Sep 17 00:00:00 2001
From: Yue Hu <[email protected]>
Date: Wed, 23 Jan 2019 16:56:48 +0800
Subject: [PATCH] pstore/ram: Make initialization check as first oneSince only one single ramoops area allowed at a time, other probes include device tree related are meaningless, it will waste cpu consumtion. So let's check it firstly.
Signed-off-by Yue Hu <[email protected]>--- fs/pstore/ram.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)fs/pstore/ram.c +9
-10@@ -715,15 +715,6 @@ static int ramoops_probe(struct platform_device *pdev)phys_addr_t paddr;int err = -EINVAL ; -if (dev_of_node (dev) && !pdata) { - pdata = &pdata_local; -memset (pdata,0 ,sizeof (*pdata)); - - err =ramoops_parse_dt (pdev, pdata); -if (err <0 ) - goto fail_out; - } -/* * Only a single ramoops area allowed at a time, so fail extra * probes. @@ -733,6 +724,15 @@ static int ramoops_probe(struct platform_device *pdev) goto fail_out; } +if (dev_of_node (dev) && !pdata) { + pdata = &pdata_local; +memset (pdata,0 ,sizeof (*pdata)); + + err =ramoops_parse_dt (pdev, pdata); +if (err <0 ) + goto fail_out; + } +/* Make sure we didn't get bogus platform data pointer. */ if (!pdata) {pr_err ("NULL platform data\n" ); --
Quoted 1 line
1.9.1
Applied, thanks!
Signature · 1 line
Kees Cook