提交 7c807572 编写于 作者: J Jonathan Lemon 提交者: Jakub Kicinski

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: 773bda96 ("ptp: ocp: Expose various resources on the timecard.")
Signed-off-by: NJonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
上级 fd04ed1c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册