Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Avoid crash during dump when finding an evicted BO
@ 2025-10-12 12:45 Simon Richter
  2025-10-12 12:45 ` [PATCH 1/1] drm/ttm: Avoid NULL pointer deref for evicted BOs Simon Richter
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Simon Richter @ 2025-10-12 12:45 UTC (permalink / raw)
  To: intel-xe; +Cc: Simon Richter

Hi,

this is the horrible, but short implementation to avoid dereferencing
bo->resource when it is NULL. As far as I can see, that can happen if a BO
is evicted, and maybe for other reasons as well, and most other places
looking at bo->resource will also do a NULL pointer check.

Is the "if (!ptr) ... else switch(ptr->member) { ... }" pattern acceptable,
should I do a "goto out;" instead, or should I duplicate the unlocking
path?

   Simon

Simon Richter (1):
  drm/ttm: Avoid NULL pointer deref for evicted BOs

 drivers/gpu/drm/ttm/ttm_bo_vm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-12-08  7:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-12 12:45 [PATCH 0/1] Avoid crash during dump when finding an evicted BO Simon Richter
2025-10-12 12:45 ` [PATCH 1/1] drm/ttm: Avoid NULL pointer deref for evicted BOs Simon Richter
2025-10-12 23:09   ` Matthew Brost
2025-10-13 16:02     ` [PATCH v2] " Simon Richter
2025-10-13 16:11       ` [PATCH v3] " Simon Richter
2025-10-13 16:27         ` Matthew Brost
2025-12-05 17:46           ` Lin, Shuicheng
2025-12-05 18:25             ` Matthew Brost
2025-12-08  7:54               ` Christian König
2025-10-12 12:52 ` ✗ CI.checkpatch: warning for Avoid crash during dump when finding an evicted BO Patchwork
2025-10-12 12:53 ` ✓ CI.KUnit: success " Patchwork
2025-10-12 13:35 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-12 14:47 ` ✗ Xe.CI.Full: failure " Patchwork
2025-10-13 18:03 ` ✓ CI.KUnit: success for Avoid crash during dump when finding an evicted BO (rev3) Patchwork
2025-10-13 18:39 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-13 22:03 ` ✗ Xe.CI.Full: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox