From: David Herrmann Date: Sun, 24 Aug 2014 17:23:26 +0000 (+0200) Subject: drm: fix division-by-zero on dumb_create() X-Git-Tag: omap-fixes-against-v3.17-rc3~38^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00e7208997d7a42b6f7b22f582523755f43a2f9b;p=pandora-kernel.git drm: fix division-by-zero on dumb_create() 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 overflow if (n + d - 1) is bigger than UINT_MAX. Reported-by: Tommi Rantala Signed-off-by: David Herrmann Reviewed-by: Rob Clark Signed-off-by: Dave Airlie --- Reading git-diff-tree failed