From patchwork Tue Oct 27 13:54:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 307287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD2BDC61DD8 for ; Tue, 27 Oct 2020 16:47:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 627272225E for ; Tue, 27 Oct 2020 16:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603817224; bh=RbRdRmxmA7c51+g6PuhXswlxwb3qBKIwuI4P+E8fAes=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VDGWugnss/WmtJb6Bp44ZvUY7jeTniYaJUDqidB/+152qFEBA5J7/OPOJwb6FNDGz viHRly3/DJ29jTEJta4/UfPfVOdJ2SPWqPB5VVTfTsVVe3VQB6zilzrN0SgYdHXDtP 2kggNTVtPlMzpbTA1ARJ5lDJvu4nxzSnA8SVnmrE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1812962AbgJ0QrC (ORCPT ); Tue, 27 Oct 2020 12:47:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:51910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1795014AbgJ0POx (ORCPT ); Tue, 27 Oct 2020 11:14:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A310F20657; Tue, 27 Oct 2020 15:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811693; bh=RbRdRmxmA7c51+g6PuhXswlxwb3qBKIwuI4P+E8fAes=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wQeAMbrgLNvtlhCJddzJ5b+fxK5ZtEd3GObsmfJSacZV+Sbpo3/V2aAxbcq5xtLiT MNiUGNVvEt4zJ4C7xUVfXcghFHV5g6HKqWy2+z8Rm3pfdiLNTF0hi7bMO89D7fGjf6 HZG6J9tVVAKgiDq6HoCvDVvoz/1g5U/WIZ9XYviY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.8 552/633] media: atomisp: fix memleak in ia_css_stream_create Date: Tue, 27 Oct 2020 14:54:55 +0100 Message-Id: <20201027135548.694178269@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dinghao Liu [ 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 Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/atomisp/pci/sh_css.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index 54434c2dbaf90..8473e14370747 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -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++)