kernel: bump 5.4 to 5.4.153
[openwrt/staging/chunkeey.git] / target / linux / layerscape / patches-5.4 / 701-net-0399-staging-fsl_ppfe-eth-Enhance-error-checking-in-platf.patch
1 From 1ccc18ca96d8a824f2af45d1046d23ccdb90f3df Mon Sep 17 00:00:00 2001
2 From: Anji Jagarlmudi <anji.jagarlmudi@nxp.com>
3 Date: Wed, 8 Jan 2020 12:18:40 +0530
4 Subject: [PATCH] staging: fsl_ppfe/eth: Enhance error checking in platform
5 probe
6
7 Fix the kernel crash when MAC addr is not passed in dtb.
8
9 Signed-off-by: Anji Jagarlmudi <anji.jagarlmudi@nxp.com>
10 ---
11 drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c | 10 +++++++---
12 1 file changed, 7 insertions(+), 3 deletions(-)
13
14 --- a/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c
15 +++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c
16 @@ -31,7 +31,11 @@ static int pfe_get_gemac_if_properties(s
17 const u32 *addr;
18
19 addr = of_get_property(gem, "reg", &size);
20 - port = be32_to_cpup(addr);
21 + if (addr)
22 + port = be32_to_cpup(addr);
23 + else
24 + goto err;
25 +
26
27 pdata->ls1012a_eth_pdata[port].gem_id = port;
28