Skip to content

Commit

Permalink
unifykey: check return value of of_property_read_u32
Browse files Browse the repository at this point in the history
PD#150092: Calling "of_property_read_u32" without checking return value
driver defect clean up:
torvalds#30

Change-Id: I590627fec489e2251c689b9a013d5c792ff19975
Signed-off-by: Jiamin Ma <[email protected]>
  • Loading branch information
Jiamin Ma authored and akiernan committed Nov 4, 2022
1 parent f1edd29 commit d765b50
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/amlogic/unifykey/unifykey_dts.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,13 @@ int unifykey_dt_create(struct platform_device *pdev)
__LINE__);
return ret;
}
/* set default efuse version info */
unify_key_info.efuse_version = -1;
of_property_read_u32(pdev->dev.of_node, "efuse-version",

ret = of_property_read_u32(pdev->dev.of_node, "efuse-version",
&unify_key_info.efuse_version);
if (ret != 0) {
pr_info("no efuse-version set, use default value: -1\n");
unify_key_info.efuse_version = -1;
}

pr_info("key unify config unifykey-num is %d\n", key_num);
unify_key_info.key_num = key_num;
Expand Down

0 comments on commit d765b50

Please sign in to comment.