Re: [PATCH 5/5] staging: tidspbridge: check the return value of kstrtol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 30, 2012 at 3:34 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
...
>> --- 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) {
>> +             ret = kstrtol(sz_last_token, 10, (long *)&req);
>
> req is an s32 so this will corrupt memory on a 64 bit system.  One
> option would be to use.
>                 ret = kstrtos32(sz_last_token, 10, &req);
> But maybe a better option might be to change the type of "req" to
> some more normal C type if there isn't a specific reason for it to
> be s32.

AFAIK, there is no reason for having s32, but let me confirm it and
will resubmit.

Thanks,

Omar
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux