Skip to content

Commit

Permalink
staging: tidspbridge: replace strict_strtol() with kstrtos32()
Browse files Browse the repository at this point in the history
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: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jingoo Han authored and Greg Kroah-Hartman committed Jul 24, 2013
1 parent 72bb99c commit 932ef36
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/staging/tidspbridge/pmgr/dbll.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,11 @@ static int dbll_rmm_alloc(struct dynamic_loader_allocate *this,
or DYN_EXTERNAL, then mem granularity information is present
within the section name - only process if there are at least three
tokens within the section name (just a minor optimization) */
if (count >= 3)
strict_strtol(sz_last_token, 10, (long *)&req);
if (count >= 3) {
status = kstrtos32(sz_last_token, 10, &req);
if (status)
goto func_cont;
}

if ((req == 0) || (req == 1)) {
if (strcmp(sz_sec_last_token, "DYN_DARAM") == 0) {
Expand Down

0 comments on commit 932ef36

Please sign in to comment.