drm/sun4i: dsi: Prevent underflow when computing packet sizes
Currently, the packet overhead is subtracted using unsigned arithmetic. With a short sync pulse, this could underflow and wrap around to near the maximal u16 value. Fix this by using signed subtraction. The call to max() will correctly handle any negative numbers that are produced. Apply the same fix to the other timings, even though those subtractions are less likely to underflow. Fixes: 133add5b ("drm/sun4i: Add Allwinner A31 MIPI-DSI controller support") Signed-off-by: NSamuel Holland <samuel@sholland.org> Reviewed-by: NJernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: NMaxime Ripard <maxime@cerno.tech> Link: https://lore.kernel.org/r/20220812031623.34057-1-samuel@sholland.org
Showing
想要评论请 注册 或 登录