From: "Thomas Hellström (Intel)" <thomas_os@shipmail.org>
To: Jasmine Newsome <jasmine.newsome@intel.com>,
Intel-GFX@Lists.FreeDesktop.Org
Cc: thomas.hellstrom@intel.com
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gem: Use local pointer ttm for __i915_ttm_move
Date: Wed, 8 Dec 2021 11:10:49 +0100 [thread overview]
Message-ID: <8486ebdc-05b4-858e-7e00-0d9de1dccdd0@shipmail.org> (raw)
In-Reply-To: <20211203214931.1635863-1-jasmine.newsome@intel.com>
Hi, Jasmine,
On 12/3/21 22:49, Jasmine Newsome wrote:
> To avoid confusion with deferencing possible null pointer bo->ttm,
> replace pointer bo->ttm with local pointer ttm in i915_ttm_move
> as ttm has checks for null before getting passed to __i915_ttm_move
It's OK to use the local variable ttm here because it has previously
been assigned from bo->ttm.
However, if a static analyzer gets confused by that and the fact that a
NULL pointer might be passed to __i915_ttm_move, (which will not
dereference it), then that's a static analyzer false positive.
So the commit message needs to be rewritten saying something like the
code is getting a bit more readable if the local variable is used since
it was previously assigned from bo->ttm, that's ok.
Also please add your Signed-off-by: To the patch.
Thanks,
Thomas
> ---
> drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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 80df9f592407..56b6573b5c93 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
> @@ -763,7 +763,7 @@ int i915_ttm_move(struct ttm_buffer_object *bo, bool evict,
> return PTR_ERR(dep);
> }
>
> - migration_fence = __i915_ttm_move(bo, clear, dst_mem, bo->ttm,
> + migration_fence = __i915_ttm_move(bo, clear, dst_mem, ttm,
> dst_rsgt, true, dep);
> dma_fence_put(dep);
> }
next prev parent reply other threads:[~2021-12-08 10:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 21:49 [Intel-gfx] [PATCH] drm/i915/gem: Use local pointer ttm for __i915_ttm_move Jasmine Newsome
2021-12-03 23:22 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-12-03 23:49 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-12-04 11:37 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-12-08 10:10 ` Thomas Hellström (Intel) [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-12-09 6:33 [Intel-gfx] [PATCH] " Jasmine Newsome
2021-12-09 16:23 Jasmine Newsome
[not found] <20211209000533.1670512-1-jasmine.newsome@intel.com>
2021-12-10 13:32 ` Hellstrom, Thomas
2022-01-04 20:36 Jasmine Newsome
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8486ebdc-05b4-858e-7e00-0d9de1dccdd0@shipmail.org \
--to=thomas_os@shipmail.org \
--cc=Intel-GFX@Lists.FreeDesktop.Org \
--cc=jasmine.newsome@intel.com \
--cc=thomas.hellstrom@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox