Commit 2c13ab1ab41936a4219b1106d7c7e275198cf3b2

Authored by Oliver Brown
1 parent 4b5c45752d

MLK-20367 drm/bridge: sec-dsim: Fix potential arithmetic overflow

Coverity reported potential arithmetic overflow of a 32-bit
multiply operation. Adding a cast to promote the mulitply opertion to use
64 bits.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/gpu/drm/bridge/sec-dsim.c
... ... @@ -1118,7 +1118,7 @@
1118 1118 if (bpp < 0)
1119 1119 return -EINVAL;
1120 1120  
1121   - pix_clk = mode->clock * 1000;
  1121 + pix_clk = (uint64_t)mode->clock * 1000;
1122 1122 bit_clk = DIV_ROUND_UP_ULL(pix_clk * bpp, dsim->lanes);
1123 1123  
1124 1124 if (bit_clk > pdata->max_data_rate) {