Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp158763pxx; Wed, 28 Oct 2020 01:04:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVKn9XR22xsmYfoY9KFttXBAe5Q7tgLOjO/Y0eDSKudIeISYiyyjrEXnG4xChLzUsNg+ew X-Received: by 2002:a17:906:7210:: with SMTP id m16mr6719821ejk.490.1603872269663; Wed, 28 Oct 2020 01:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603872269; cv=none; d=google.com; s=arc-20160816; b=XVI1CKPzvdOcExwbsiBshSOf36W8W9aF+BZxHsO9JdPIHeet+SW+OMHezKZbxPomo4 EnRxH2Y7L1N9yM/xMX3NJQZx/DjvPWaanjgSZzUzybgEvzVKqkpLYuZkBP8/3HIiRoOe 7xZzFhluvt9Uyr5AlhjAkqAWU4TurtRRIFkdx/HaNhW9ALKywbX1CZORhuOTxAelbIeo GBa39fAKU6N+tvypv21nwOlzWxfwojuOvqoxFc7aHV815qSNOy9bbJUdtLeqli225+Ai fIQLA+cB1f7G4vBSviLJwXjUKPtjhd4o/T0GKfvvGDYeayIkMIrKWWuH9/gRWv5Xc+40 Rbww== 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=WZjtZlYhUhxUXK6Pn4UY6hoSG7y3Abvz2uVfW+OeNTY=; b=WtP/N9b6TWZaBovM7VFIooRT9PeGGClihXq4RuygVj+tEQjgbani1qd2kM583LoRi3 SavColLrDP9wp31KNJushesAQBZ35sl9weP+5fmp1ZhVdW8CSqDKWiS7o9Zrv7jtKts4 OlxpCT8S8+cs/M1khanPq3ZiTpeFmgIEICoWU/U3OiKaO+gBDxd82z+METzrTwChxsIq bkH0fu8tBW6XnUVWpWecInoGPXis8Zs7paTbL3hbQY1MLQukPqB2gHDkRGr/oqnkuV3f YYqr8rff+M3i07tRSF/kbvnK8N5NAXaCAlj3iE6DW4a9XIJOPKVHdQ1SMV9kdE0T5UwW MTpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1sD4FnJm; 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 w11si2719069ejq.533.2020.10.28.01.04.07; Wed, 28 Oct 2020 01:04:29 -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=1sD4FnJm; 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 S1752890AbgJ0N5b (ORCPT + 99 others); Tue, 27 Oct 2020 09:57:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:44280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752878AbgJ0N53 (ORCPT ); Tue, 27 Oct 2020 09:57:29 -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 52A692072E; Tue, 27 Oct 2020 13:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807048; bh=0lCCpahTBNuXu2xc+K/yXybvTM+ozJ1f/gEnyV0NCIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1sD4FnJm7LtPeC8PWyBh8mjYtGnV1avZSd6vnwneLQKHl5fYxwi9fnfuWd3rYqBB/ WM+pgUUM4+hk1Fj8CsOFysGsTbo7UBo7vdQR9VloTfBNOPShlGDH+orLUalQAsjyPf 7vioB84ErIcTM0Sqa9+1nb7f3pB2aXM7RAVxsieo= 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 4.4 023/112] media: omap3isp: Fix memleak in isp_probe Date: Tue, 27 Oct 2020 14:48:53 +0100 Message-Id: <20201027134901.664945159@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 f41e0d08de93e..4c6842202e47c 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2388,8 +2388,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