[media] s5p-mfc: Fix initialization of internal structures
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 3 Feb 2017 14:05:18 +0000 (12:05 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 5 Apr 2017 18:40:04 +0000 (15:40 -0300)
commit7c96f59e0cafe5777c533b147128a577dee1564b
tree10c187059741e75c34a5117cadcdf9bf17b137f6
parent0fad6e2372074e69b7c2048fec86f5a4bcbb3edb
[media] s5p-mfc: Fix initialization of internal structures

Initialize members of the internal device and context structures as early
as possible to avoid access to uninitialized objects on initialization
failures. If loading firmware or creating of the hardware instance fails,
driver will access device or context queue in error handling path, which
might not be initialized yet, what causes kernel panic. Fix this by moving
initialization of all static members as early as possible.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/s5p-mfc/s5p_mfc.c