Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp611920pxx; Wed, 28 Oct 2020 12:22:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAYI0wPXitEBAr2an+/mHpqc6LPx3tLe6iF+pH+EuP+b/BBK3+NeAR7mDUL+DV6MWsUPjX X-Received: by 2002:a17:906:d8ce:: with SMTP id re14mr576612ejb.275.1603912966838; Wed, 28 Oct 2020 12:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603912966; cv=none; d=google.com; s=arc-20160816; b=wFNk9n5ACGdp+9mHucN2c2nw8i9zo8SzR49yHdgHGD3VfhK+GF4VP5+1NFPRU1BLEN 0OARy8ZWF0WJ6cmwwXwoNMXuLii8Rwm6+sj6D0Tlr7GVrG0uN5jU+REe2z4Gg11QK0hC xg3+P99nZyt4Q3p1B2oZNGENmkwQ8kT4oB1HVN0so8GPzdbGPFFZ3GEc2RKmvrKgJmwd E61RbJLo0UzGVG78szD+QLq0SsSOhzj5ai2uI3r0QtkW4CRAdit2UP3XypfPWSaqcoDK GLPSuyB0pSVoBxTeSoPpzFarxxhdJMSEXzdcRlKcI/1MC63tV06PVhaWcGoQ9djiUlUT BRWg== 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=SyAx0AbHHTqwTetOAG1ZAJiTewxlbWpx7NQ/r0O9oPc=; b=EHBhhhlQR+iPXfSlWaH5Guf9Ga+Q2rVTd/7j+VUJVshqsTC2pq5J5Q60otTeYV2jPY VVZsjHm39ER7pRUkoAcwX2b8UwZy0PsA7A2Q5jRASbEvsQjYtGWUowgqFnHrzGl9vHxh y6IM++AEKLjUQv46oSyvYlWaGIW/KBYEC9b88vIGo2+2ZWrXWp2IfTjf/67FUIgU9zft wYGf/1JEo3reaK9oyrHFbiyKxjAZswdC25x8Dd7LI4JlVn1XUvWQzjnLj/RRbeS8QORE OYIBkn1YbSbSZTPOnM7fNmn7Ucoq0lEA8o0xMF8WOPOteM1EEtY2XAdV6rIqX5G8VcTh u6Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jb76HpS+; 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 y6si18713edm.295.2020.10.28.12.22.24; Wed, 28 Oct 2020 12:22:46 -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=jb76HpS+; 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 S1827306AbgJ0SWy (ORCPT + 99 others); Tue, 27 Oct 2020 14:22:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:50280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753819AbgJ0OCZ (ORCPT ); Tue, 27 Oct 2020 10:02:25 -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 76B302225E; Tue, 27 Oct 2020 14:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807345; bh=xTXpPhnYPS4+NPnzn8lqRGTmKplAA2LjtamtUbUYMnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jb76HpS+3Jm9ZnZv26sVLsiem5pUoam5zWuRFQ8uou/wbPcSGPaaEExBCFoWz/5ju BxlUK8nRvLMhLc3LlhHv/5yZmaNFnMhBdWqW1MGnI/vCMnX/m8a4+gGIujSj1kzmdO H1WEclTb8aaBbkJLRK1qFC9Vvk8LuUZFekZmbIN4= 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.9 019/139] media: omap3isp: Fix memleak in isp_probe Date: Tue, 27 Oct 2020 14:48:33 +0100 Message-Id: <20201027134903.041611778@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@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 ce651d3ca1b82..a56863b090144 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2273,8 +2273,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