[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210816221337.390645-2-jonathan.lemon@gmail.com>
Date: Mon, 16 Aug 2021 15:13:34 -0700
From: Jonathan Lemon <jonathan.lemon@...il.com>
To: kuba@...nel.org, davem@...emloft.net, richardcochran@...il.com
Cc: kernel-team@...com, netdev@...r.kernel.org
Subject: [PATCH net-next v2 1/4] 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.
Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the
timecard.")
Signed-off-by: Jonathan Lemon <jonathan.lemon@...il.com>
---
drivers/ptp/ptp_ocp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 92edf772feed..9e4317d1184f 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;
--
2.31.1
Powered by blists - more mailing lists