[Intel-gfx] [PATCH] Fixes KW issue for NULL pointer dereference
Jani Nikula
jani.nikula at linux.intel.com
Thu Aug 11 15:35:34 UTC 2022
The subject needs a prefix. For example "i915/drm:" or something more
specific, see git log.
Please use the imperative mood in the subject and commit message,
i.e. "fix" instead of "fixes" or "fixed".
On Thu, 11 Aug 2022, Tapas Rana <tapas.rana at intel.com> wrote:
> - adds a NULL pointer check for the input parameter
Please write proper sentences. It's not a bulleted list.
This patch seems to be a v2 of an earlier patch. It's customary to add a
change history of the patch. Also, use --subject-prefix or -v<N>
parameter to add the version in the subject like "[PATCH v2]". See
patches on the list.
>
> Signed-off-by: Tapas Rana <tapas.rana at intel.com>
> ---
> drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
> index 9a7e50534b84..de7c892aabc5 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
> @@ -435,6 +435,9 @@ i915_ttm_memcpy_work_arm(struct i915_ttm_memcpy_work *work,
> static bool i915_ttm_memcpy_allowed(struct ttm_buffer_object *bo,
> struct ttm_resource *dst_mem)
> {
> + if (!bo)
> + return false;
> +
Finally, AFAICT it's not possible to reach here with NULL bo; it
would've been referenced before...
BR,
Jani.
> if (i915_gem_object_needs_ccs_pages(i915_ttm_to_gem(bo)))
> return false;
--
Jani Nikula, Intel Open Source Graphics Center
More information about the Intel-gfx
mailing list