media: cx18: check for allocation failure in cx18_read_eeprom()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 22 Nov 2013 07:51:47 +0000 (04:51 -0300)
committerJiri Slaby <jslaby@suse.cz>
Mon, 31 Mar 2014 12:22:26 +0000 (14:22 +0200)
commitd5ce3633797811aa7274d49cc13aff4d1665b22e
tree2358fdb96d1177b4326b4ce2e31644078d10a516
parent560febde5250115f1ac28fe21ee72790e09e42d9
media: cx18: check for allocation failure in cx18_read_eeprom()

commit e351bf25fa373a3de0be2141b962c5c3c27006a2 upstream.

It upsets static checkers when we don't check for allocation failure.  I
moved the memset() of "tv" earlier so we don't use uninitialized data on
error.
Fixes: 1d212cf0c2d8 ('[media] cx18: struct i2c_client is too big for stack')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/media/pci/cx18/cx18-driver.c