media: cetrus: return an error if alloc fails
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 7 Dec 2018 11:13:48 +0000 (06:13 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 7 Dec 2018 13:39:04 +0000 (08:39 -0500)
commit9ed5d5fb8b432badc967decf97e4294cbb216eef
treed52424a1dc78796c26ae5f149c3e316784bdae37
parente82a34fa89f82509b5fe79b65fc351038c560a5b
media: cetrus: return an error if alloc fails

As warned by smatch:

drivers/staging/media/sunxi/cedrus/cedrus.c: drivers/staging/media/sunxi/cedrus/cedrus.c:93 cedrus_init_ctrls() error: potential null dereference 'ctx->ctrls'.  (kzalloc returns null)

While here, remove the memset(), as kzalloc() already zeroes the
struct.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/staging/media/sunxi/cedrus/cedrus.c