On Mon, Sep 26, 2011 at 12:00 PM, Joe Perches <[email protected]> wrote:
> On Sun, 2011-09-25 at 21:15 -0400, Kevin McKinney wrote:
>> This patch fixes two issues within bcm/Bcmchar.c.
> []
>
> It's reasonable and shorter to combine these tests.
>
>                if (IoBuffer.OutputLength == 0 ||
>                    IoBuffer.OutputLength > USHRT_MAX)
>                        return -EINVAL;

You are correct. I will submit another patch.

>> +
>>               Bufflen = IoBuffer.OutputLength + (4 - 
>> IoBuffer.OutputLength%4)%4;
>
> Not your issue, but because it's near the patched bits:
>
> Because of the two modulos, this is not straightforward.
> Perhaps a temporary helps.
>
>                Bufflen = IoBuffer.OutputLength;
>                u16 extra = Bufflen % 4;
>                if (extra)
>                        Bufflen += 4 - extra;

I will make this change as well.

>>               temp_buff = kmalloc(Bufflen, GFP_KERNEL);
>>               if (!temp_buff)
>
Thanks,
Kevin
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to