> -----Original Message----- > From: Kandpal, Suraj <[email protected]> > Sent: Tuesday, 2 September 2025 10.54 > To: Kahola, Mika <[email protected]>; [email protected]; > [email protected] > Cc: Kahola, Mika <[email protected]> > Subject: RE: [PATCH] drm/i915/display: Fix possible overflow on tc power > domain selection > > > Subject: [PATCH] drm/i915/display: Fix possible overflow on tc power > > domain selection > > Maybe drm/i915/tc since it's isolated to tc file > > > > > There is a possibility that intel_encoder_to_tc() functions returns > > negative i.e. > > Typo should be just *function
Right, I will fix that. Thanks for the review! > > Other wise LGTM, > Reviewed-by: Suraj Kandpal <[email protected]> > > > TC_PORT_NONE (-1) value which may cause > > tc_port_power_domain() function to overflow. To fix this, let's add > > additional check that returns invalid power domain i.e. > > POWER_DOMAIN_INVALID in case tc port equals TC_PORT_NONE. > > > > Signed-off-by: Mika Kahola <[email protected]> > > --- > > drivers/gpu/drm/i915/display/intel_tc.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/gpu/drm/i915/display/intel_tc.c > > b/drivers/gpu/drm/i915/display/intel_tc.c > > index 583fed5a386d..23745fc99d35 100644 > > --- a/drivers/gpu/drm/i915/display/intel_tc.c > > +++ b/drivers/gpu/drm/i915/display/intel_tc.c > > @@ -249,6 +249,9 @@ tc_port_power_domain(struct intel_tc_port *tc) { > > enum tc_port tc_port = intel_encoder_to_tc(&tc->dig_port->base); > > > > + if (tc_port == TC_PORT_NONE) > > + return POWER_DOMAIN_INVALID; > > + > > return POWER_DOMAIN_PORT_DDI_LANES_TC1 + tc_port - TC_PORT_1; } > > > > -- > > 2.34.1
