From: Jingoo Han Date: Wed, 24 Jul 2013 05:34:08 +0000 (+0900) Subject: staging: tidspbridge: replace strict_strtol() with kstrtos32() X-Git-Tag: v3.11-rc3~11^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=932ef3685f287799fa844862d607a6b596ba5b9e;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/tidspbridge/pmgr/dbll.c b/drivers/staging/tidspbridge/pmgr/dbll.c index c191ae20356..41e88abe47a 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, 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) {