Message ID | 20240219131423.1854991-1-tvrtko.ursulin@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915: Fix possible null pointer dereference after drm_dbg_printer conversion | expand |
On Mon, Feb 19, 2024 at 01:14:23PM +0000, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > Request can be NULL if no guilty request was identified so simply use > engine->i915 instead. > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > Fixes: d50892a9554c ("drm/i915: switch from drm_debug_printer() to device specific drm_dbg_printer()") > Reported-by: Dan Carpenter <dan.carpenter@linaro.org> > Cc: Jani Nikula <jani.nikula@intel.com> > Cc: Luca Coelho <luciano.coelho@intel.com> > Cc: Maxime Ripard <mripard@kernel.org> > Cc: Jani Nikula <jani.nikula@linux.intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > --- > drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c > index 5f8d86e25993..8d4bb95f8424 100644 > --- a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c > +++ b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c > @@ -96,8 +96,8 @@ static void heartbeat_commit(struct i915_request *rq, > static void show_heartbeat(const struct i915_request *rq, > struct intel_engine_cs *engine) > { > - struct drm_printer p = drm_dbg_printer(&rq->i915->drm, DRM_UT_DRIVER, > - "heartbeat"); > + struct drm_printer p = > + drm_dbg_printer(&engine->i915->drm, DRM_UT_DRIVER, "heartbeat"); > > if (!rq) { > intel_engine_dump(engine, &p, > -- > 2.40.1 >
On 19/02/2024 20:02, Rodrigo Vivi wrote: > On Mon, Feb 19, 2024 at 01:14:23PM +0000, Tvrtko Ursulin wrote: >> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >> >> Request can be NULL if no guilty request was identified so simply use >> engine->i915 instead. >> >> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >> Fixes: d50892a9554c ("drm/i915: switch from drm_debug_printer() to device specific drm_dbg_printer()") >> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> >> Cc: Jani Nikula <jani.nikula@intel.com> >> Cc: Luca Coelho <luciano.coelho@intel.com> >> Cc: Maxime Ripard <mripard@kernel.org> >> Cc: Jani Nikula <jani.nikula@linux.intel.com> > > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Thanks Rodrigo! Given how d50892a9554c landed via drm-misc-next, Maxime or Thomas - could you take this via drm-misc-next-fixes or if there will be another drm-misc-next pull request? Regards, Tvrtko > >> --- >> drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c >> index 5f8d86e25993..8d4bb95f8424 100644 >> --- a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c >> +++ b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c >> @@ -96,8 +96,8 @@ static void heartbeat_commit(struct i915_request *rq, >> static void show_heartbeat(const struct i915_request *rq, >> struct intel_engine_cs *engine) >> { >> - struct drm_printer p = drm_dbg_printer(&rq->i915->drm, DRM_UT_DRIVER, >> - "heartbeat"); >> + struct drm_printer p = >> + drm_dbg_printer(&engine->i915->drm, DRM_UT_DRIVER, "heartbeat"); >> >> if (!rq) { >> intel_engine_dump(engine, &p, >> -- >> 2.40.1 >>
On Tue, Feb 20, 2024 at 09:16:43AM +0000, Tvrtko Ursulin wrote: > > On 19/02/2024 20:02, Rodrigo Vivi wrote: > > On Mon, Feb 19, 2024 at 01:14:23PM +0000, Tvrtko Ursulin wrote: > > > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > > > > > Request can be NULL if no guilty request was identified so simply use > > > engine->i915 instead. > > > > > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> > > > Fixes: d50892a9554c ("drm/i915: switch from drm_debug_printer() to device specific drm_dbg_printer()") > > > Reported-by: Dan Carpenter <dan.carpenter@linaro.org> > > > Cc: Jani Nikula <jani.nikula@intel.com> > > > Cc: Luca Coelho <luciano.coelho@intel.com> > > > Cc: Maxime Ripard <mripard@kernel.org> > > > Cc: Jani Nikula <jani.nikula@linux.intel.com> > > > > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > > Thanks Rodrigo! > > Given how d50892a9554c landed via drm-misc-next, Maxime or Thomas - could > you take this via drm-misc-next-fixes or if there will be another > drm-misc-next pull request? There will be a drm-misc-next PR on thursday Maxime
On 20/02/2024 10:36, Maxime Ripard wrote: > On Tue, Feb 20, 2024 at 09:16:43AM +0000, Tvrtko Ursulin wrote: >> >> On 19/02/2024 20:02, Rodrigo Vivi wrote: >>> On Mon, Feb 19, 2024 at 01:14:23PM +0000, Tvrtko Ursulin wrote: >>>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >>>> >>>> Request can be NULL if no guilty request was identified so simply use >>>> engine->i915 instead. >>>> >>>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> >>>> Fixes: d50892a9554c ("drm/i915: switch from drm_debug_printer() to device specific drm_dbg_printer()") >>>> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> >>>> Cc: Jani Nikula <jani.nikula@intel.com> >>>> Cc: Luca Coelho <luciano.coelho@intel.com> >>>> Cc: Maxime Ripard <mripard@kernel.org> >>>> Cc: Jani Nikula <jani.nikula@linux.intel.com> >>> >>> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> >> >> Thanks Rodrigo! >> >> Given how d50892a9554c landed via drm-misc-next, Maxime or Thomas - could >> you take this via drm-misc-next-fixes or if there will be another >> drm-misc-next pull request? > > There will be a drm-misc-next PR on thursday Could you pull this one into which branch is needed so it appears in that pull request? Regards, Tvrtko
On Mon, 19 Feb 2024 13:14:23 +0000, Tvrtko Ursulin wrote: > Request can be NULL if no guilty request was identified so simply use > engine->i915 instead. > > Applied to drm/drm-misc (drm-misc-next-fixes). Thanks! Maxime
diff --git a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c index 5f8d86e25993..8d4bb95f8424 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +++ b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c @@ -96,8 +96,8 @@ static void heartbeat_commit(struct i915_request *rq, static void show_heartbeat(const struct i915_request *rq, struct intel_engine_cs *engine) { - struct drm_printer p = drm_dbg_printer(&rq->i915->drm, DRM_UT_DRIVER, - "heartbeat"); + struct drm_printer p = + drm_dbg_printer(&engine->i915->drm, DRM_UT_DRIVER, "heartbeat"); if (!rq) { intel_engine_dump(engine, &p,