diff options
author | Jonathan Lemon <jonathan.lemon@gmail.com> | 2021-08-16 15:13:34 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-08-16 17:18:35 -0700 |
commit | 7c8075728f4df477d94df2e4d23a95ee69ee9493 (patch) | |
tree | 2e1a22f786c66024a9d64cf1d5ff28e205e506aa /drivers/ptp | |
parent | fd04ed1ca37f3f0767b8e42b32fcc078f99e6193 (diff) | |
download | linux-7c8075728f4df477d94df2e4d23a95ee69ee9493.tar.gz linux-7c8075728f4df477d94df2e4d23a95ee69ee9493.tar.bz2 linux-7c8075728f4df477d94df2e4d23a95ee69ee9493.zip |
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@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/ptp')
-rw-r--r-- | drivers/ptp/ptp_ocp.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |