drivers: can: common: Fix uninitializes sjw
Fix coverity CID 216784. SJW was not initialized in the tmp_res, but got copied to the result pointer, which overwrites the value. Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
This commit is contained in:
parent
ecf918cadd
commit
09ef2e667f
1 changed files with 3 additions and 1 deletions
|
@ -216,7 +216,9 @@ static int can_calc_timing_int(uint32_t core_clock, struct can_timing *res,
|
||||||
|
|
||||||
if (sp_err < sp_err_min) {
|
if (sp_err < sp_err_min) {
|
||||||
sp_err_min = sp_err;
|
sp_err_min = sp_err;
|
||||||
*res = tmp_res;
|
res->prop_seg = tmp_res.prop_seg;
|
||||||
|
res->phase_seg1 = tmp_res.phase_seg1;
|
||||||
|
res->phase_seg2 = tmp_res.phase_seg2;
|
||||||
res->prescaler = (uint16_t)prescaler;
|
res->prescaler = (uint16_t)prescaler;
|
||||||
if (sp_err == 0) {
|
if (sp_err == 0) {
|
||||||
/* No better result than a perfect match*/
|
/* No better result than a perfect match*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue