mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-01 03:51:31 +00:00
misc: imx: scu: avoid write null pointer
When boot_dev is true, fill boot device. However the original logic is when boot_dev is false, fill boot device, this will trigger data abort. Also fix sc_misc_get_control when using pointer val. Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
parent
224f745247
commit
ecab65e4cd
1 changed files with 2 additions and 2 deletions
|
@ -169,7 +169,7 @@ int sc_misc_get_control(sc_ipc_t ipc, sc_rsrc_t resource, sc_ctrl_t ctrl,
|
||||||
printf("%s: ctrl:%d resource:%d: res:%d\n",
|
printf("%s: ctrl:%d resource:%d: res:%d\n",
|
||||||
__func__, ctrl, resource, RPC_R8(&msg));
|
__func__, ctrl, resource, RPC_R8(&msg));
|
||||||
|
|
||||||
if (!val)
|
if (val)
|
||||||
*val = RPC_U32(&msg, 0U);
|
*val = RPC_U32(&msg, 0U);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -194,7 +194,7 @@ void sc_misc_get_boot_dev(sc_ipc_t ipc, sc_rsrc_t *boot_dev)
|
||||||
if (ret)
|
if (ret)
|
||||||
printf("%s: res:%d\n", __func__, RPC_R8(&msg));
|
printf("%s: res:%d\n", __func__, RPC_R8(&msg));
|
||||||
|
|
||||||
if (!boot_dev)
|
if (boot_dev)
|
||||||
*boot_dev = RPC_U16(&msg, 0U);
|
*boot_dev = RPC_U16(&msg, 0U);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue