]> git.baikalelectronics.ru Git - kernel.git/commit
ptp: ocp: Fix uninitialized variable warning spotted by clang.
authorJonathan Lemon <jonathan.lemon@gmail.com>
Mon, 16 Aug 2021 22:13:34 +0000 (15:13 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 17 Aug 2021 00:18:35 +0000 (17:18 -0700)
commitf9a331e0a4d3cffcdcd41844dcfe23a62a2dbb60
tree2e1a22f786c66024a9d64cf1d5ff28e205e506aa
parentc26f7c43ff5e906262e62f8b099cce432ec8e761
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: a964dcf3f0ae ("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>
drivers/ptp/ptp_ocp.c