Re: drm_mode_create_dumb_ioctl: divide error

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

 



Hi

On Sun, Aug 24, 2014 at 7:12 PM, Tommi Rantala <tt.rantala@xxxxxxxxx> wrote:
> (gdb) info locals
> cpp = 0
> stride = 0
> size = <optimized out>
>
> (gdb) print /x *(struct drm_mode_create_dumb *)data
> $13 = {
>   height = 0xffffffff,
>   width = 0xffffffff,
>   bpp = 0xffffffff,
>   flags = 0xffffffff,
>   handle = 0xffffffff,
>   pitch = 0xffffffff,
>   size = 0xffffffffffffffff
> }

Thanks a lot for digging into this. Looks like DIV_ROUND_UP() can
overflow... *check*
Yes, it's defined as:
        #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))

Kinda unexpected that a function called "DIV" can overflow, but makes
sense here. Obvious fix is to test "cpp" for zero. I will send it to
dri-devel.

Thanks!
David
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux