mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
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: 773bda9649
("ptp: ocp: Expose various resources on the timecard.")
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
fd04ed1ca3
commit
7c8075728f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user