summaryrefslogtreecommitdiffstats
path: root/ft2232_spi.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2015-02-18 23:28:30 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2015-02-18 23:28:30 +0000
commitadadca66f2ce2cb03ece016ab07fef604283c667 (patch)
treeab1e4651c333e3079ad71897dcc18f4d6b342715 /ft2232_spi.c
parent400b3adc8a4e073648e2512be9cd7bab94d8f8f8 (diff)
downloadast2050-flashrom-adadca66f2ce2cb03ece016ab07fef604283c667.zip
ast2050-flashrom-adadca66f2ce2cb03ece016ab07fef604283c667.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. Corresponding to flashrom svn r1885. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Alexandre Boeglin <alex@boeglin.org>
Diffstat (limited to 'ft2232_spi.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud