ion: Do not 'put' ION handle until after its final use

pass_to_user() eventually calls kref_put() on an ION handle which is
still live, potentially allowing for it to be legitimately freed by
the client.

Prevent this from happening before its final use in both ION_IOC_ALLOC
and ION_IOC_IMPORT.

Issue: SEC-3341
Issue: SEC-3344
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c47385c73fced27375559d1a2eb10f165a0869b0)
Change-Id: Iedc75c5923e3e71974595bc79bb5c75220dc3226
1 file changed