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:
pfg 2016-05-13 15:57:55 +00:00
parent 572ca36439
commit 0519015a5a

View File

@ -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: