[dm-devel] [PATCH] dm-clone: make array descs static

2021-09-15 Thread Colin King
From: Colin Ian King Don't populate the read-only array descs on the stack but instead it static and add extra const. Also makes the object code smaller by 66 bytes: Before: textdata bss dec hex filename 42382 11140 512 54034d312 ./drivers/md/dm-clone-target.o A

[dm-devel] [PATCH][next] dm ima: Fix resource leaks on error return path

2021-08-03 Thread Colin King
From: Colin Ian King Currently there is an error check on r that immediately returns on an error rather than taking the error clean-up exit path via label 'error'. Fix this to avoid resource leaks. Addresses-Coverity: ("Resourced leak") Fixes: 0a3bec81a409 ("dm ima: measure data on table load")

[dm-devel] [PATCH] dm: remove redundant continue statement

2021-06-16 Thread Colin King
From: Colin Ian King The continue statement at the end of a for-loop has no effect, remove it. Addresses-Coverity: ("Continue has no effect") Signed-off-by: Colin Ian King --- drivers/md/dm-ps-io-affinity.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/md/dm-ps-io-affinity.c b/dri

[dm-devel] [PATCH][V2][next] dm space maps: Fix uninitialized variable r2

2021-05-23 Thread Colin King
From: Colin Ian King In the case where recursing(mm) is true variable r2 is not inintialized and an uninitialized value is being used in the call combine_errors later on. Fix this by setting r2 to zero. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: def6a7a9a7f0 ("dm space maps: im

[dm-devel] [PATCH][next] dm space map disk: remove redundant initialization of variable index

2021-05-23 Thread Colin King
From: Colin Ian King The variable index is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/md/persistent-data/dm-space-map-common.c |

[dm-devel] [PATCH][next] dm btree: Fix potential read of array with negative index i

2021-05-23 Thread Colin King
From: Colin Ian King The call to lower_bound can return -1 if the key is not found with the bsearch, leading to a negative index access into array node->keys[]. Ensure this cannot occur by checking for a negative index before reading from the array. Addresses-Coverity: ("Negative array index rea

[dm-devel] [PATCH][next] dm space maps: Fix uninitialized variable r2

2021-05-23 Thread Colin King
From: Colin Ian King In the case where recursing(mm) is true variable r2 is not inintialized and an uninitialized value is being used in the call combine_errors later on. Fix this by setting r2 to zero. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: def6a7a9a7f0 ("dm space maps: im

[dm-devel] [PATCH][next] dm integrity: fix spelling mistake "flusing" -> "flushing"

2021-01-12 Thread Colin King
From: Colin Ian King There is a spelling mistake in a dm_integrity_io_error error message. Fix it. Signed-off-by: Colin Ian King --- drivers/md/dm-integrity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 11c7c53

[dm-devel] [PATCH][next] dm zoned: fix memory leak of newly allocated zone on xa_insert failure

2020-06-05 Thread Colin King
From: Colin Ian King Currently if an xa_insert fails then there is a memory lead of the recently allocated zone object. Fix this by kfree'ing zone before returning on the error return path. Addresses-Coverity: ("Resource leak") Fixes: 1a311efa3916 ("dm zoned: convert to xarray") Signed-off-by: C

[dm-devel] [PATCH][next] dm: remove redundant unsigned comparison to less than zero

2019-05-06 Thread Colin King
From: Colin Ian King Variable block is an unsigned long long hence the less than zero comparison is always false, hence it is redundant and can be removed. Addresses-Coverity: ("Unsigned compared against 0") Signed-off-by: Colin Ian King --- drivers/md/dm-dust.c | 2 +- 1 file changed, 1 inser

[dm-devel] [PATCH] dm: integrity: fix spelling mistake in workqueue name

2018-11-28 Thread Colin King
From: Colin Ian King The workqueue name contains a spelling mistake, rename the workqueue from dm-intergrity-recalc to dm-integrity-recalc Signed-off-by: Colin Ian King --- drivers/md/dm-integrity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-integrity.c b

[dm-devel] [PATCH][next] dm writecache: fix missing goto in error handling code

2018-05-28 Thread Colin King
From: Colin Ian King Currently, the -EFBIG error condition when n_bitmaps_bits is too large is falling through to the next statement and the error assignment to r is potentially being ignored. The code should be exiting to the error path via label 'bad'. Fix this by adding the missing goto state

[dm-devel] [PATCH][V2] dm ioctl: make dm_open and dm_release release static

2017-05-10 Thread Colin King
From: Colin Ian King Making dm_open and dm_release static fixes the sparse warnings: warning: symbol 'dm_open' was not declared. Should it be static? warning: symbol 'dm_release' was not declared. Should it be static? Fixes: ab2c6224f4c0c ("dm: a basic support for using the select or poll func

[dm-devel] [PATCH] dm ioctl: make dm_open and dm_release release

2017-05-10 Thread Colin King
From: Colin Ian King Making dm_open and dm_release static fixes the sparse warnings: warning: symbol 'dm_open' was not declared. Should it be static? warning: symbol 'dm_release' was not declared. Should it be static? Fixes: ab2c6224f4c0c ("dm: a basic support for using the select or poll func

[dm-devel] [PATCH] dm cache: handle kmalloc failure allocating background_tracker struct

2017-03-13 Thread Colin King
From: Colin Ian King currently there is no kmalloc failure check on the allocation of the background_tracker struct variable b, and so a null return will lead to a null pointer deference error. Add null check and move the failure debug message and NULL return so that the two allocation errors can