Blame SOURCES/0010-checkpolicy-remove-dead-assignments.patch

83845a
From 7723180fa09b0c483c07a76a4678f2c2cd51bff6 Mon Sep 17 00:00:00 2001
83845a
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
83845a
Date: Tue, 6 Jul 2021 19:54:27 +0200
83845a
Subject: [PATCH] checkpolicy: remove dead assignments
83845a
MIME-Version: 1.0
83845a
Content-Type: text/plain; charset=UTF-8
83845a
Content-Transfer-Encoding: 8bit
83845a
83845a
The variable `cladatum` is otherwise always assigned before used, so
83845a
these two assignments without a follow up usages are not needed.
83845a
83845a
Found by clang-analyzer.
83845a
83845a
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
83845a
---
83845a
 checkpolicy/checkpolicy.c | 4 ----
83845a
 1 file changed, 4 deletions(-)
83845a
83845a
diff --git a/checkpolicy/checkpolicy.c b/checkpolicy/checkpolicy.c
83845a
index b52595a87b29..58edcc34e8cc 100644
83845a
--- a/checkpolicy/checkpolicy.c
83845a
+++ b/checkpolicy/checkpolicy.c
83845a
@@ -1179,8 +1179,6 @@ int main(int argc, char **argv)
83845a
 					printf("\nNo such class.\n");
83845a
 					break;
83845a
 				}
83845a
-				cladatum =
83845a
-				    policydb.class_val_to_struct[tclass - 1];
83845a
 			} else {
83845a
 				ans[strlen(ans) - 1] = 0;
83845a
 				cladatum =
83845a
@@ -1232,8 +1230,6 @@ int main(int argc, char **argv)
83845a
 					printf("\nNo such class.\n");
83845a
 					break;
83845a
 				}
83845a
-				cladatum =
83845a
-				    policydb.class_val_to_struct[tclass - 1];
83845a
 			} else {
83845a
 				ans[strlen(ans) - 1] = 0;
83845a
 				cladatum =
83845a
-- 
83845a
2.32.0
83845a