[PATCH][next] iommu/vt-d: Fix dereference of pointer info before it is null checked

2021-06-11 Thread Colin King
From: Colin Ian King The assignment of iommu from info->iommu occurs before info is null checked hence leading to a potential null pointer dereference issue. Fix this by assigning iommu and checking if iommu is null after null checking info. Addresses-Coverity: ("Dereference before null check")

[PATCH] iommu: remove redundant assignment to variable agaw

2021-04-16 Thread Colin King
From: Colin Ian King The variable agaw is initialized with a value that is never read and it is being updated later with a new value as a counter in a for-loop. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/io

[PATCH][next] iommu: Fix spelling mistake "sixe" -> "size"

2021-03-19 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King --- drivers/iommu/sprd-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/sprd-iommu.c b/drivers/iommu/sprd-iommu.c index 7100ed17dcce..e1dc2f7d56

[PATCH][next][V2] iommu/mediatek: Fix unsigned domid comparison with less than zero

2021-02-04 Thread Colin King
From: Colin Ian King Currently the check for domid < 0 is always false because domid is unsigned. Fix this by casting domid to an int before making the comparison. Addresses-Coverity: ("Unsigned comparison against 0") Signed-off-by: Colin Ian King --- V2: cast domid rather than making it an in

[PATCH][next] iommu/mediatek: Fix unsigned domid comparison with less than zero

2021-02-03 Thread Colin King
From: Colin Ian King Currently the check for domid < 0 is always false because domid is unsigned. Fix this by making it signed. Addresses-CoverityL ("Unsigned comparison against 0") Fixes: ab1d5281a62b ("iommu/mediatek: Add iova reserved function") Signed-off-by: Colin Ian King --- drivers/io

[PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation

2020-11-25 Thread Colin King
From: Colin Ian King An incorrect sizeof() is being used, sizeof(tsk) is not correct, it should be sizeof(*tsk). Fix it. Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)") Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming DMA APIs") Signed-off-by: Colin Ian King

[PATCH] dma-mapping: fix an uninitialized pointer read due to typo in argp assignment

2020-11-25 Thread Colin King
From: Colin Ian King The assignment of argp is currently using argp as the source because of a typo. Fix this by assigning it the value passed in arg instead. Addresses-Coverity: ("Uninitialized pointer read") Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming DMA APIs") Sig

[PATCH] OMAP: iommu: check for failure of a call to omap_iommu_dump_ctx

2020-07-14 Thread Colin King
From: Colin Ian King It is possible for the call to omap_iommu_dump_ctx to return a negative error number, so check for the failure and return the error number rather than pass the negative value to simple_read_from_buffer. Addresses-Coverity: ("Improper use of negative value") Fixes: 14e0e6796a

[PATCH] iommu/amd: remove redundant assignment to variable npages

2019-05-11 Thread Colin King
From: Colin Ian King The variable npages is being initialized however this is never read and later it is being reassigned to a new value. The initialization is redundant and hence can be removed. Addresses-Coverity: ("Unused Value") Signed-off-by: Colin Ian King --- drivers/iommu/amd_iommu.c |

[PATCH] iommu/fsl: fix spelling mistake pci_endpt_partioning -> pci_endpt_partitioning

2018-09-11 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake in variable name Signed-off-by: Colin Ian King --- drivers/iommu/fsl_pamu_domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index f089136e9c3f

[PATCH] iommu/amd: fix missing tag from dev_err message

2018-07-02 Thread Colin King
From: Colin Ian King Currently tag is being assigned but not used, it is missing from the dev_err message, so add it in. Cleans up clang warning: warning: variable 'tag' set but not used [-Wunused-but-set-variable] Fixes: e7f63ffc1bf1 ("iommu/amd: Update logging information for new event type")

[PATCH] iommu/amd: remove redundant variable tag

2018-07-02 Thread Colin King
From: Colin Ian King Variable tag is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'tag' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King --- drivers/iommu/amd_iommu.c | 3 +-- 1 file changed, 1

[PATCH] dma-mapping: make variable max_segment static

2018-06-23 Thread Colin King
From: Colin Ian King The variable max_segment is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: kernel/dma/swiotlb.c:91:14: warning: symbol 'max_segment' was not declared. Should it be static? Signed-off-by: Colin Ian King --- kernel/

[PATCH] iommu/amd: remove unused variable flush_addr

2017-10-22 Thread Colin King
From: Colin Ian King Variable flush_addr is being assigned but is never read; it is redundant and can be removed. Cleans up the clang warning: drivers/iommu/amd_iommu.c:2388:2: warning: Value stored to 'flush_addr' is never read Signed-off-by: Colin Ian King --- drivers/iommu/amd_iommu.c | 2