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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 11 Aug 2021 11:31:31 -0700
From:   Jonathan Lemon <jonathan.lemon@...il.com>
To:     davem@...emloft.net, kuba@...nel.org, richardcochran@...il.com
Cc:     netdev@...r.kernel.org, kernel-team@...com
Subject: [PATCH net-next 1/3] ptp: ocp: Fix uninitialized variable warning spotted by clang.

If attempting to flash the firmware with a blob of size 0,
the entire write loop is skipped and the uninitialized err
is returned.  Fix by setting to 0 first.

Also remove a now-unused error handling statement.

Signed-off-by: Jonathan Lemon <jonathan.lemon@...il.com>
---
 drivers/ptp/ptp_ocp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 92edf772feed..9b2ba06ebf97 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -763,7 +763,7 @@ ptp_ocp_devlink_flash(struct devlink *devlink, struct device *dev,
 	size_t off, len, resid, wrote;
 	struct erase_info erase;
 	size_t base, blksz;
-	int err;
+	int err = 0;
 
 	off = 0;
 	base = bp->flash_start;
@@ -847,8 +847,6 @@ ptp_ocp_devlink_info_get(struct devlink *devlink, struct devlink_info_req *req,
 							       "loader",
 							       buf);
 		}
-		if (err)
-			return err;
 	}
 
 	if (!bp->has_serial)
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ