]> git.baikalelectronics.ru Git - kernel.git/commit
[media] stv090x: handle allocation failures
authorDan Carpenter <error27@gmail.com>
Tue, 15 Feb 2011 10:10:08 +0000 (07:10 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 21 Mar 2011 23:32:36 +0000 (20:32 -0300)
commit82c7785a788d202fc24d2f2072cebb4b106110bc
tree9ddac7f907a90e7ca9e433122c058ecf80c82c77
parent8f67ddee2a499479948ec3e17b720fc95eabcf3d
[media] stv090x: handle allocation failures

kmalloc() can fail so check whether state->internal is NULL.
append_internal() can return NULL on allocation failures so check that.
Also if we hit the error condition later in the function then there is
a memory leak and we need to call remove_dev() to fix it.

Also Oliver Endriss pointed out an additional leak that I missed in the
first version of this patch.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/stv090x.c