Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp508325pxx; Wed, 28 Oct 2020 09:55:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS0dznQJW78Shz0nUveVU/NrLZH+fLGQJQpfh3LYzePwH9shgPrjRhGj8cnlGhdm9iQuqm X-Received: by 2002:a17:906:12cf:: with SMTP id l15mr8932717ejb.540.1603904136478; Wed, 28 Oct 2020 09:55:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603904136; cv=none; d=google.com; s=arc-20160816; b=RNEfCqI4STdGuPjR+xFvOsSLDpDfyJm64nXadBYtUlgHJWzprw3F7nKmRQvcqTpBvM BpOrAdzRUYqjnoY7d2aCcCw4Z6Ys+fMDxc5W99Imd8i7b3+N54vtMmzfg5CN+p7i1ysA +xwyerz0+FueiZdfKNWRLJrJZez6QRzA5hgqDj2zPbeb63O/9tQoIykA52eX/datPNrr 4rwaVfEom7jz7h5u9kuomW3+4R493Il0cyWO/di10GcjN5BWE3Cg2rd1iaeeyecrZdzw 88TXqfD370dVP7fse9rSY1Zijz63xLepN9EAaZIPELMz7EZLrhCk4Fs13vX13UJSBUXo bgkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1EAt29JVry7ihCYTlIFgFtyUwf6RvqN2x5iwKXNujpw=; b=KfC5l1azd/8FRlCJsfdF8T2jSTPogu99jvfQXJ6b2NTvs0pJlOchx1r3cWJpCr370E Y64FharEamwovObr34GUBy6KnQleUlEuMbN7uBKtR+L/WDP8AwwE8OOkJGNvHbsJhanZ dIWpEw9yoOKkaidd41O+8P+fsKZNlTMvYRoXMpMqrbc29EwP3mSbu1gzfOe744weBxDj prfiB+2Uj9APQCZ55rkMIx/XTPpQTuYlOrCfIT2kvwx5JmsVOeJwvO13bCbgdVTEwiSq 19O65xpLFLHNstiXRzelrmXlzokv/6YRNtZRyqj+F4NK3iD5ohdB1fi1/sfOYcHvT5mr LN/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b+QQn5A+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m26si11386edq.372.2020.10.28.09.55.14; Wed, 28 Oct 2020 09:55:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b+QQn5A+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1818968AbgJ0R0P (ORCPT + 99 others); Tue, 27 Oct 2020 13:26:15 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); -- 2.25.1