> -----Original Message----- > From: Intel-gfx <intel-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Suraj > Kandpal > Sent: Monday, July 22, 2024 12:15 PM > To: intel-gfx@xxxxxxxxxxxxxxxxxxxxx; intel-xe@xxxxxxxxxxxxxxxxxxxxx > Cc: Nautiyal, Ankit K <ankit.k.nautiyal@xxxxxxxxx>; Kandpal, Suraj > <suraj.kandpal@xxxxxxxxx> > Subject: [PATCH 2/3] drm/i915/hdcp: Add encoder check in > hdcp2_get_capability > > Add encoder check in intel_hdcp2_get_capability to avoid null pointer error. > > Signed-off-by: Suraj Kandpal <suraj.kandpal@xxxxxxxxx> LGTM. Thanks. Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@xxxxxxxxx> > --- > drivers/gpu/drm/i915/display/intel_dp_hdcp.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c > b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c > index 2edffe62f360..47f51a5ab493 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp_hdcp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp_hdcp.c > @@ -675,8 +675,15 @@ static > int intel_dp_hdcp2_get_capability(struct intel_connector *connector, > bool *capable) > { > - struct intel_digital_port *dig_port = > intel_attached_dig_port(connector); > - struct drm_dp_aux *aux = &dig_port->dp.aux; > + struct intel_digital_port *dig_port; > + struct drm_dp_aux *aux; > + > + *capable = false; > + if (!intel_attached_encoder(connector)) > + return -EINVAL; > + > + dig_port = intel_attached_dig_port(connector); > + aux = &dig_port->dp.aux; > > return _intel_dp_hdcp2_get_capability(aux, capable); } > -- > 2.43.2