diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2015-02-18 23:28:30 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2015-02-18 23:28:30 +0000 |
commit | 676f4acf2bc1d970d7336c6d2d5a950866d8b13c (patch) | |
tree | ab1e4651c333e3079ad71897dcc18f4d6b342715 /ft2232_spi.c | |
parent | bd4334254cd1df33f24a890ee505ffb42a04656e (diff) | |
download | flashrom-676f4acf2bc1d970d7336c6d2d5a950866d8b13c.tar.gz |
Fix a number of problems in mstarddc_spi.c.
Coverity has brought up the following problems:
mstarddc_spi_send_command():
- CID 1270702: bad comparison of malloced pointer 'cmd'.
- CID 1270701: a NULL pointer dereference possible because of above.
Simply checking the return value of malloc in a valid way fixes both problems.
mstarddc_spi_init():
- CID 1270699 and 1270700: Memory leak of i2c_device.
This patch revamps the function in various ways to fix these issues and some
other irritating bits.
It reduces scopes of variables where possible, pushes the code towards our
coding standards and introduces a label-based resource cleanup at the end.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Alexandre Boeglin <alex@boeglin.org>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1885 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'ft2232_spi.c')
0 files changed, 0 insertions, 0 deletions