]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: atomisp: fix memleak in ia_css_stream_create
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Fri, 21 Aug 2020 05:49:16 +0000 (07:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:12:11 +0000 (10:12 +0100)
[ Upstream commit c1bca5b5ced0cbd779d56f60cdbc9f5e6f6449fe ]

When aspect_ratio_crop_init() fails, curr_stream needs
to be freed just like what we've done in the following
error paths. However, current code is returning directly
and ends up leaking memory.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/atomisp/pci/sh_css.c

index a68cbb4995f0f3e02b63a84cafb384c274b02aad..33a0f8ff82aa8e8616d338b46d11a6c907e44fd5 100644 (file)
@@ -9521,7 +9521,7 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
        if (err)
        {
                IA_CSS_LEAVE_ERR(err);
-               return err;
+               goto ERR;
        }
 #endif
        for (i = 0; i < num_pipes; i++)