Coverity: dispc_vp_mode_valid(): Integer handling issues

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

 



Hello!

This is an experimental automated report about issues detected by Coverity
from a scan of next-20200413 as part of the linux-next weekly scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:

  Fri Nov 8 09:45:28 2019 +0200
    32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem")

Coverity reported the following:

*** CID 1461667:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/drivers/gpu/drm/tidss/tidss_dispc.c: 1175 in dispc_vp_mode_valid()
1169     		return MODE_BAD_VVALUE;
1170
1171     	if (dispc->memory_bandwidth_limit) {
1172     		const unsigned int bpp = 4;
1173     		u64 bandwidth;
1174
vvv     CID 1461667:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
vvv     Potentially overflowing expression "1000 * mode->clock" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "u64" (64 bits, unsigned).
1175     		bandwidth = 1000 * mode->clock;
1176     		bandwidth = bandwidth * mode->hdisplay * mode->vdisplay * bpp;
1177     		bandwidth = div_u64(bandwidth, mode->htotal * mode->vtotal);
1178
1179     		if (dispc->memory_bandwidth_limit < bandwidth)
1180     			return MODE_BAD;

If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):

Reported-by: coverity-bot <keescook+coverity-bot@xxxxxxxxxxxx>
Addresses-Coverity-ID: 1461667 ("Integer handling issues")
Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem")

Thanks for your attention!

-- 
Coverity-bot



[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux