mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-12 09:58:36 +00:00
i2c(8): uninitialized variable (UNINIT).
If i2c_opt.width is somehow zero, buf will be left uninitialized and may cause trouble later on. This is a followup to r299586. CID: 1331548
This commit is contained in:
parent
587fe827b3
commit
48235fe344
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299682
@ -294,8 +294,10 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf)
|
||||
err_msg = "error: offset malloc";
|
||||
goto err1;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
bufsize = 0;
|
||||
buf = NULL;
|
||||
}
|
||||
|
||||
switch(i2c_opt.mode) {
|
||||
case I2C_MODE_STOP_START:
|
||||
|
Loading…
Reference in New Issue
Block a user