Dan Carpenter d1a0f34c91 drm/i915/overlay: Prevent divide by zero bugs in scaling
commit 90a3d22ff02b196d5884e111f39271a1d4ee8e3e upstream.

Smatch detected a divide by zero bug in check_overlay_scaling().

    drivers/gpu/drm/i915/display/intel_overlay.c:976 check_overlay_scaling()
    error: potential divide by zero bug '/ rec->dst_height'.
    drivers/gpu/drm/i915/display/intel_overlay.c:980 check_overlay_scaling()
    error: potential divide by zero bug '/ rec->dst_width'.

Prevent this by ensuring that the dst height and width are non-zero.

Fixes: 02e792fbaadb ("drm/i915: implement drmmode overlay support v4")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220124122409.GA31673@kili
(cherry picked from commit cf5b64f7f10b28bebb9b7c9d25e7aee5cbe43918)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-08 18:23:17 +01:00
..
2019-12-13 08:52:44 +01:00
2020-06-30 23:17:17 -04:00
2018-06-22 12:58:08 +10:00
2021-11-26 11:36:24 +01:00
2018-06-28 13:29:07 +10:00
2018-07-13 18:40:28 +02:00
2020-02-11 04:34:07 -08:00
2018-12-13 09:16:21 +01:00
2021-03-30 14:36:58 +02:00