drm/i915/backlight: Fix divide by 0 error in i9xx_set_backlight
pwm_level_max maybe 0 we do throw a warning but move ahead with execution which may later cause a /0 error. --v2 -return if the warn_on gets hit [Jani] Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Link: https://lore.kernel.org/r/20250819160438.145734-1-suraj.kandpal@intel.com
This commit is contained in:
@@ -236,7 +236,8 @@ static void i9xx_set_backlight(const struct drm_connector_state *conn_state, u32
|
||||
struct intel_panel *panel = &connector->panel;
|
||||
u32 tmp, mask;
|
||||
|
||||
drm_WARN_ON(display->drm, panel->backlight.pwm_level_max == 0);
|
||||
if (drm_WARN_ON(display->drm, panel->backlight.pwm_level_max == 0))
|
||||
return;
|
||||
|
||||
if (panel->backlight.combination_mode) {
|
||||
struct pci_dev *pdev = to_pci_dev(display->drm->dev);
|
||||
|
||||
Reference in New Issue
Block a user