lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200512173801.222666-1-colin.king@canonical.com>
Date:   Tue, 12 May 2020 18:38:01 +0100
From:   Colin King <colin.king@...onical.com>
To:     Kees Cook <keescook@...omium.org>,
        Anton Vorontsov <anton@...msg.org>,
        Colin Cross <ccross@...roid.com>,
        Tony Luck <tony.luck@...el.com>
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] pstore/zone: remove redundant initializations to variable ret

From: Colin Ian King <colin.king@...onical.com>

The variable rc is being initialized with a value that is never read and it
is being updated later with a new value.  The initialization is redundant
and can be removed.  In one of the cases, ret can also be moved inside a
for-loop to reduce the scope.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 fs/pstore/zone.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c
index 3cf7d6762c76..419de481c69c 100644
--- a/fs/pstore/zone.c
+++ b/fs/pstore/zone.c
@@ -600,7 +600,7 @@ static int psz_recover_zones(struct psz_context *cxt,
  */
 static inline int psz_recovery(struct psz_context *cxt)
 {
-	int ret = -EBUSY;
+	int ret;
 
 	if (atomic_read(&cxt->recovered))
 		return 0;
@@ -746,13 +746,13 @@ static void psz_write_kmsg_hdr(struct pstore_zone *zone,
 static inline int notrace psz_kmsg_write_record(struct psz_context *cxt,
 		struct pstore_record *record)
 {
-	int ret = -EBUSY;
 	size_t size, hlen;
 	struct pstore_zone *zone;
 	unsigned int i;
 
 	for (i = 0; i < cxt->kmsg_max_cnt; i++) {
 		unsigned int zonenum, len;
+		int ret;
 
 		zonenum = (cxt->kmsg_write_cnt + i) % cxt->kmsg_max_cnt;
 		zone = cxt->kpszs[zonenum];
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ