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:08:20 +0000 (10:08 +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 54434c2dbaf904d8037b8f709452ede91ee8e744..8473e1437074794e95a3e4c30de0e51e7b117d4d 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++)