[PATCH] drm: fix division-by-zero on dumb_create()

2014-08-24 Thread David Herrmann
Kinda unexpected, but DIV_ROUND_UP() can overflow if passed an argument bigger than UINT_MAX - DIVISOR. Fix this by testing for "!cpp" before using it in the following division. Note that DIV_ROUND_UP() is defined as: #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) ..this will obviously

[PATCH] drm: fix division-by-zero on dumb_create()

2014-08-24 Thread Rob Clark
On Sun, Aug 24, 2014 at 1:23 PM, David Herrmann wrote: > Kinda unexpected, but DIV_ROUND_UP() can overflow if passed an argument > bigger than UINT_MAX - DIVISOR. Fix this by testing for "!cpp" before > using it in the following division. > > Note that DIV_ROUND_UP() is defined as: > #def