From patchwork Tue Oct 27 13:47:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312050 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 0D5DAC56202 for ; Tue, 27 Oct 2020 17:25:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3A3B2076B for ; Tue, 27 Oct 2020 17:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603819558; bh=USYYtO6VgYTrA5w3ydkn75nox/VqrlDSuPJidgcGUgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t8R/Hv0cQIxtzn5YXt0qgTq5Go1XRd0iWUoMtUW5GJVSPEh2sWcJ11D/15RbD81O2 47H/a2jq83Dpt7eHJvEmtOS9e4GcmYXqpzaswJTtAv25TvY4FgFPMZypa1OYr0/wya tPQODAhqqLO4RT+m4WyOUkAfopc6aVD68c/qmClo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S369862AbgJ0RZy (ORCPT ); Tue, 27 Oct 2020 13:25:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:53408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1775609AbgJ0Ow5 (ORCPT ); Tue, 27 Oct 2020 10:52:57 -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 B611A22264; Tue, 27 Oct 2020 14:52:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810375; bh=USYYtO6VgYTrA5w3ydkn75nox/VqrlDSuPJidgcGUgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b+QQn5A+2KIvjVtQb8FWKWwsJGhofhL2BAecEv3/Kdz4AgQnofs7E91ymLUT6GHT6 z1Nh72gKt+D4/Xrcbo3SvZ0VfSYpO1daA1DUzB/o/t3mLX6IzMCDN+RyVbHuFYkgFI Q32Z3qYd++EaKYdhx1Vc+jJmirQEVrJyeg2LR1Cg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.8 118/633] media: omap3isp: Fix memleak in isp_probe Date: Tue, 27 Oct 2020 14:47:41 +0100 Message-Id: <20201027135528.237164558@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 d8fc21c17099635e8ebd986d042be65a6c6b5bd0 ] When devm_ioremap_resource() fails, isp should be freed just like other error paths in isp_probe. Fixes: 8644cdf972dd6 ("[media] omap3isp: Replace many MMIO regions by two") Signed-off-by: Dinghao Liu Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/omap3isp/isp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index b91e472ee764e..de066757726de 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2328,8 +2328,10 @@ static int isp_probe(struct platform_device *pdev) mem = platform_get_resource(pdev, IORESOURCE_MEM, i); isp->mmio_base[map_idx] = devm_ioremap_resource(isp->dev, mem); - if (IS_ERR(isp->mmio_base[map_idx])) - return PTR_ERR(isp->mmio_base[map_idx]); + if (IS_ERR(isp->mmio_base[map_idx])) { + ret = PTR_ERR(isp->mmio_base[map_idx]); + goto error; + } } ret = isp_get_clocks(isp);