Closed nickdesaulniers closed 5 years ago
Seems like the use of stmmac_get_timestamp
is problematic in the first 4 cases, and stmmac_config_sub_second_increment
in the second. Also, line numbers of the above are off due to them coming from linux-next, but I still see the issue in mainline.
stmmac_get_timestamp
expands to stmmac_do_void_callback
, which invokes a function it's passed (get_timestamp
) and forwards the rest of the args to that function.
The issue is that the check in stmmac_do_void_callback
if ever false would not call the callback, and potentially not initialize the variable.
Doesn't hurt to just initialize the variable ns
.
sec_inc
has the same problem in stmmac_config_sub_second_increment
which expands to stmmac_do_void_callback
again but invokes the passed callback config_sub_second_increment
which may or may not get called. Almost every other local variable in stmmac_config_sub_second_increment
is zero initialized, except sec_inc
.
Another fix accepted: https://git.kernel.org/davem/net/c/1f5d861f7fefa971b2c6e766f77932c86419a319
from #381