Commit 4d62121
Marc Zyngier
KVM: arm64: vgic-debug: Avoid dereferencing NULL ITE pointer
Dan reports that iterating over a device ITEs can legitimately lead
to a NULL pointer, and that the NULL check is placed *after* the
pointer has already been dereferenced.
Hoist the pointer check as early as possible and be done with it.
Reported-by: Dan Carpenter <[email protected]>
Fixes: 30deb51 ("KVM: arm64: vgic-its: Add debugfs interface to expose ITS tables")
Link: https://lore.kernel.org/r/[email protected]
Cc: Jing Zhang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marc Zyngier <[email protected]>1 parent 07212d1 commit 4d62121
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
493 | 496 | | |
494 | 497 | | |
495 | 498 | | |
| |||
498 | 501 | | |
499 | 502 | | |
500 | 503 | | |
501 | | - | |
| 504 | + | |
502 | 505 | | |
503 | 506 | | |
504 | 507 | | |
| |||
0 commit comments