media: [next] staging: media: atomisp: fix memory leak of object flash
authorColin Ian King <colin.king@canonical.com>
Wed, 2 Sep 2020 16:58:52 +0000 (18:58 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 22 Mar 2021 16:12:30 +0000 (17:12 +0100)
commit6045b01dd0e3cd3759eafe7f290ed04c957500b1
treec884b1903d80b6552ea541da53f208678e4d3019
parent548ad8ee68c034300b714b297fe18b16a8a4f797
media: [next] staging: media: atomisp: fix memory leak of object flash

In the case where the call to lm3554_platform_data_func returns an
error there is a memory leak on the error return path of object
flash.  Fix this by adding an error return path that will free
flash and rename labels fail2 to fail3 and fail1 to fail2.

Link: https://lore.kernel.org/linux-media/20200902165852.201155-1-colin.king@canonical.com
Fixes: 9289cdf39992 ("staging: media: atomisp: Convert to GPIO descriptors")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/i2c/atomisp-lm3554.c