media: staging/intel-ipu3: Fix memory leak in imu_fmt
authorRicardo Ribalda <ribalda@chromium.org>
Mon, 15 Mar 2021 12:34:05 +0000 (13:34 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 9 Apr 2021 11:06:48 +0000 (13:06 +0200)
commit3630901933afba1d16c462b04d569b7576339223
tree341b39a80b533cda1b954293d06782927fd083dc
parent4103369093df0e2ccc295ad08a3077b72aed0ccb
media: staging/intel-ipu3: Fix memory leak in imu_fmt

We are losing the reference to an allocated memory if try. Change the
order of the check to avoid that.

Cc: stable@vger.kernel.org
Fixes: 6d5f26f2e045 ("media: staging/intel-ipu3-v4l: reduce kernel stack usage")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/ipu3/ipu3-v4l2.c