Skip to contentSkip to conversation

locking/ww_mutex: Prevent read of uninitialized memory

PATCH Superseded Robert Foss 1 participant 1 message Mar 7, 2017 Locking primitives

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 locking/ww_mutex: Prevent read of uninitialized memory

abba.result is potentially uninitialized, but read during one error condition.

On "missed ABBA deadlock" abba.result is read, but not initialized in all situations.

Detected by CoverityScan, CID#1402035 ("Uninitialized scalar variable")

---
 kernel/locking/test-ww_mutex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/locking/test-ww_mutex.c +1 -1
index da6c9a34f62f..d11ad012bae6 100644
@@ -196,7 +196,7 @@ static void test_abba_work(struct work_struct *work)
 
 static int test_abba(bool resolve)
 {
-	struct test_abba abba;
+	struct test_abba abba = { 0 };
 	struct ww_acquire_ctx ctx;
 	int err, ret;
 
Signature · 1 line
2.11.0.453.g787f75f05