i2c(8): uninitialized variable (UNINIT).

If i2c_opt.width is somehow zero, the bufsize will be left uninitialized
and make cause trouble later on.

CID:		1331549
This commit is contained in:
Pedro F. Giffuni 2016-05-13 02:58:11 +00:00
parent 8877d1dbe6
commit b1f46f712f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299586

View File

@ -294,7 +294,8 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c_buf)
err_msg = "error: offset malloc";
goto err1;
}
}
} else
bufsize = 0;
switch(i2c_opt.mode) {
case I2C_MODE_STOP_START: