s5p-mfc: Fix clock management in s5p_mfc_release() function
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 14 Nov 2016 14:09:26 +0000 (12:09 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Jan 2017 07:24:45 +0000 (08:24 +0100)
commit3bef7578e05f8188743641da8bc7ddfdbb64d268
tree338128427a7a7deb35c87b2ae996286209407c69
parentd47e1e7c46fed13f6e9d60c98f8352c714db695e
s5p-mfc: Fix clock management in s5p_mfc_release() function

commit c0026c7bfb95c250c3e34fde59f96ad72fd730d6 upstream.

Clock control indirectly requires access to MFC device, so call it only
if we are sure that the device exists in s5p_mfc_release function.
s5p_mfc_remove() calls s5p_mfc_final_pm(), which releases all PM related
resources, including clocks, so any call to clocks related functions
is not valid after s5p_mfc_final_pm().

Fixes: d695c12 ("[media] media: s5p-mfc fix invalid memory access from
s5p_mfc_release()")

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/s5p-mfc/s5p_mfc.c