diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-07-24 01:34:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 12:51:18 -0400 |
commit | 932ef3685f287799fa844862d607a6b596ba5b9e (patch) | |
tree | b2ed564b9fbf3bfd84579dc94d88761a201c7372 /drivers/staging | |
parent | 72bb99cfe9c57d2044445fb34bbc95b4c0bae6f2 (diff) |
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: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/tidspbridge/pmgr/dbll.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/tidspbridge/pmgr/dbll.c b/drivers/staging/tidspbridge/pmgr/dbll.c index c191ae203565..41e88abe47af 100644 --- a/drivers/staging/tidspbridge/pmgr/dbll.c +++ b/drivers/staging/tidspbridge/pmgr/dbll.c | |||
@@ -1120,8 +1120,11 @@ static int dbll_rmm_alloc(struct dynamic_loader_allocate *this, | |||
1120 | or DYN_EXTERNAL, then mem granularity information is present | 1120 | or DYN_EXTERNAL, then mem granularity information is present |
1121 | within the section name - only process if there are at least three | 1121 | within the section name - only process if there are at least three |
1122 | tokens within the section name (just a minor optimization) */ | 1122 | tokens within the section name (just a minor optimization) */ |
1123 | if (count >= 3) | 1123 | if (count >= 3) { |
1124 | strict_strtol(sz_last_token, 10, (long *)&req); | 1124 | status = kstrtos32(sz_last_token, 10, &req); |
1125 | if (status) | ||
1126 | goto func_cont; | ||
1127 | } | ||
1125 | 1128 | ||
1126 | if ((req == 0) || (req == 1)) { | 1129 | if ((req == 0) || (req == 1)) { |
1127 | if (strcmp(sz_sec_last_token, "DYN_DARAM") == 0) { | 1130 | if (strcmp(sz_sec_last_token, "DYN_DARAM") == 0) { |