Commit 932ef368 authored by Jingoo Han's avatar Jingoo Han Committed by Greg Kroah-Hartman

staging: tidspbridge: replace strict_strtol() with kstrtos32()

The usage of strict_strtol() is not preferred, because
strict_strtol() is obsolete. Thus, kstrtos32() should be
used in order to convert a string to s32. Also, error handling
is added to get rid of a __must_check warning.

This fixes a memory corruption bug as well.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 72bb99cf
...@@ -1120,8 +1120,11 @@ static int dbll_rmm_alloc(struct dynamic_loader_allocate *this, ...@@ -1120,8 +1120,11 @@ static int dbll_rmm_alloc(struct dynamic_loader_allocate *this,
or DYN_EXTERNAL, then mem granularity information is present or DYN_EXTERNAL, then mem granularity information is present
within the section name - only process if there are at least three within the section name - only process if there are at least three
tokens within the section name (just a minor optimization) */ tokens within the section name (just a minor optimization) */
if (count >= 3) if (count >= 3) {
strict_strtol(sz_last_token, 10, (long *)&req); status = kstrtos32(sz_last_token, 10, &req);
if (status)
goto func_cont;
}
if ((req == 0) || (req == 1)) { if ((req == 0) || (req == 1)) {
if (strcmp(sz_sec_last_token, "DYN_DARAM") == 0) { if (strcmp(sz_sec_last_token, "DYN_DARAM") == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment