diff options
| author | Purva Yeshi <[email protected]> | 2025-04-10 11:02:16 +0000 |
|---|---|---|
| committer | Vinod Koul <[email protected]> | 2025-04-17 07:21:55 +0000 |
| commit | 97994333de2b8062d2df4e6ce0dc65c2dc0f40dc (patch) | |
| tree | 61be0a2cc4ed49d71e9404e46abad19f45307c83 /scripts/gcc-plugins/randomize_layout_plugin.c | |
| parent | Linux 6.15-rc1 (diff) | |
| download | kernel-97994333de2b8062d2df4e6ce0dc65c2dc0f40dc.tar.gz kernel-97994333de2b8062d2df4e6ce0dc65c2dc0f40dc.zip | |
dmaengine: idxd: cdev: Fix uninitialized use of sva in idxd_cdev_open
Fix Smatch-detected issue:
drivers/dma/idxd/cdev.c:321 idxd_cdev_open() error:
uninitialized symbol 'sva'.
'sva' pointer may be used uninitialized in error handling paths.
Specifically, if PASID support is enabled and iommu_sva_bind_device()
returns an error, the code jumps to the cleanup label and attempts to
call iommu_sva_unbind_device(sva) without ensuring that sva was
successfully assigned. This triggers a Smatch warning about an
uninitialized symbol.
Initialize sva to NULL at declaration and add a check using
IS_ERR_OR_NULL() before unbinding the device. This ensures the
function does not use an invalid or uninitialized pointer during
cleanup.
Signed-off-by: Purva Yeshi <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
Acked-by: Vinicius Costa Gomes <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/randomize_layout_plugin.c')
0 files changed, 0 insertions, 0 deletions
