Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp535187pxx; Wed, 28 Oct 2020 10:30:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyy2PjfLAZCIA/HakcRqnwI60p56iQ0GkTWL8HTi+5QHdtOEZFZ5Hme3/p8TBzF14ueiTYA X-Received: by 2002:aa7:d844:: with SMTP id f4mr8818893eds.194.1603906252099; Wed, 28 Oct 2020 10:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603906252; cv=none; d=google.com; s=arc-20160816; b=VKUYvQfYRbc8qMDL/DDCziAb9gPhzKlfDGt5I/1GwNKIypZOzvGuwZPqmbpamws93e jXAQOoVlp5bt+QMDtndS8o2+lDUWyKBJgJ/RBVhaf6WnRxA7ZXhY8T3FhwDHAa2tc779 76G5MkWgdV1rPT/jGdP+VUhSJQJLewIdb/Ymn67vieDRDCHp72yX0Kyxt+1GQRobPj5g 0xi7jxP+EymbOEtGBt5lE9Ms3eQu5J7c13wpbQ15WqjbGHj16extW9Ago+q9kEr91Qk7 iYD7/NNPpdehAxbAntkYBIKR+2HcLaTJE2Gb0Ao12G940mONCVrZ2aO5XVVr6zIQVQvp /8iQ== 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=djV7EtkkUJBs6VIo0A9jbJbZ4UHi5qnGlFD40gKcmrA=; b=vseLN+EuRE7s/7plgNR2Sd9f5lR1EtArj2HhHNwFoeAzG/H3XwyFTXFnrQP67swZMV hIg8UhW8LFEbcU0f+7oBODY32mr91Os+ZwajG4eMq4MQKPn353gJoZw0qHtY3NNhPFG6 hLB2ErjNQ109/YgZIna3sxzZnflS79fTH+YQlzy2XXbcsoIno+05ERb2rm6eXqeIRH4t EzB3i7dTJlewQQWaFlOjLUWJBbOtFSfiECtFs4Mtg7tuYmBytzcgDz9nTD15kqtzBka5 eJhC2XuY1ssOA67RiWVYKajxcT02qXL06BjhKdpD+0q1ashqyt1nKe+Ii1bJiJpg9dNa KvwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OFnqupJK; 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.10.30.29; Wed, 28 Oct 2020 10:30:52 -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=OFnqupJK; 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 S1821424AbgJ0Rni (ORCPT + 99 others); Tue, 27 Oct 2020 13:43:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:58732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2902264AbgJ0Obw (ORCPT ); Tue, 27 Oct 2020 10:31:52 -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 00D4F206DC; Tue, 27 Oct 2020 14:31:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809111; bh=FgPRMoSunv3G1y1M1ozPMDrfOB2t6eK1RvgOyrdsDlQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OFnqupJK1eizZ5LkilImDfYYGUrE8JheRJIDzb/usNLJqiJzC/WC0qohoTJvqm+6V BE5UJP6a3Y17mHtsoGHcFoMqeifkva7XwPz/37WzTBbglI/cI1ttCT4SupLciQIYNr 96YDrOafx4q0OVXR8BxvDXi1+YFP3+xubhK73na0= 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.4 078/408] media: omap3isp: Fix memleak in isp_probe Date: Tue, 27 Oct 2020 14:50:16 +0100 Message-Id: <20201027135458.675919186@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 327c5716922ac..dce6b3685e135 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2330,8 +2330,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