summaryrefslogtreecommitdiff
path: root/ft2232_spi.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2015-02-18 23:28:30 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2015-02-18 23:28:30 +0000
commit676f4acf2bc1d970d7336c6d2d5a950866d8b13c (patch)
treeab1e4651c333e3079ad71897dcc18f4d6b342715 /ft2232_spi.c
parentbd4334254cd1df33f24a890ee505ffb42a04656e (diff)
downloadflashrom-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