Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1217637pxx; Tue, 27 Oct 2020 10:59:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5ER2zXFtcys/Q8j1pX3tpLWI1ToBEEP3SoMODZk/gGZo86Q8B6WOthfkZLqWU7ClUGbSC X-Received: by 2002:aa7:c2d8:: with SMTP id m24mr3610453edp.90.1603821567812; Tue, 27 Oct 2020 10:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603821567; cv=none; d=google.com; s=arc-20160816; b=qZujLPnfOdUgtr6YUEDVBsqYBtFtxesDURUL7DFITDBviTfB1z/awrjGdTLGuj7HUT GTXpf6hNfwWvy3QR8qJOYT1o7OvCf7QTy6QzWb8TYE2+nHSWpkhX3USFFbMG01RA9mNY RyE5FeXUUzE0Vx3QGcpa/KDzEn5tKA/NapwxFTROp1IFx8OAr3kRQGQm//6crb4ZSevk CE4m41vpnN9PmGedf1lSiWvFAe+yuNOU0dJgQBt9JcCC3gkymdiXqm/kBy874Ql+HBgS c0iOE7YrEb2vZ9+zndCg4TXOgzY9fx4WwDTWjIIaazF6veVTKMml2zJROBXhCf+u0V5a JfVQ== 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=QcRIgxFW5fgIYtivL8jmu+AgC3Z6GKXqu1n3kKcPMiY=; b=YQ7XWr6TcojuKDsqHQMSjbphKoO1srQxIgTrLRi/swtEu9i4z3RO42PEtpkBvdS9U9 68U5dE4rD9RujVaH5/FVzhhFjsMKwid/D7lyAKwdAfhxxLzxkvX2qwhJGHIiGdxvzc0j XLGEKVSZ/r/QzxqRN6Po9TfYgu86BkSDV2J1zrPjpUHSYPYCAWY2sgIu90MmDDujwziF wb5ruX1KbJc/jk/RCwngbBY82/41zgurR8RV1YQd9t8XB+pPb3Yr7BqN++/lWcBEnWXK kcTJn8OWhMLa2CEy1Covz203/C9i2bjAHQT8HvmSDphgYbPQgBb3V7S0KQAeRacpQbWX KugA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CvS1G0gC; 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 p16si1456398ejw.561.2020.10.27.10.59.05; Tue, 27 Oct 2020 10:59:27 -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=CvS1G0gC; 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 S1819047AbgJ0R1H (ORCPT + 99 others); Tue, 27 Oct 2020 13:27:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:54174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1780082AbgJ0Oxs (ORCPT ); Tue, 27 Oct 2020 10:53:48 -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 8B8172071A; Tue, 27 Oct 2020 14:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810428; bh=VHdgOiu0cFIaKnbNnwJm16vfEUKRWoUX+lJJ1TXbTuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CvS1G0gC4k34GT/0wISFq+h6gEppJjxV0kDdko5b+xhRPHQ9Vw+8uuidLqZvlZ54d EPrnDcxT04AA+eQS7dmL2RP5CKsyW/5L2rwGw/mAgdtoeOM6RD1EDbYIU2VrtoCmV/ 1lNqJuWowI/paEjFmWwhb/+VfW65gLzAqHaxw8WQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Fabio Estevam , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.8 135/633] media: mx2_emmaprp: Fix memleak in emmaprp_probe Date: Tue, 27 Oct 2020 14:47:58 +0100 Message-Id: <20201027135529.025055274@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 21d387b8d372f859d9e87fdcc7c3b4a432737f4d ] When platform_get_irq() fails, we should release vfd and unregister pcdev->v4l2_dev just like the subsequent error paths. Fixes: d4e192cc44914 ("media: mx2_emmaprp: Check for platform_get_irq() error") Signed-off-by: Dinghao Liu Reviewed-by: Fabio Estevam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/mx2_emmaprp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c index df78df59da456..08a5473b56104 100644 --- a/drivers/media/platform/mx2_emmaprp.c +++ b/drivers/media/platform/mx2_emmaprp.c @@ -852,8 +852,11 @@ static int emmaprp_probe(struct platform_device *pdev) platform_set_drvdata(pdev, pcdev); irq = platform_get_irq(pdev, 0); - if (irq < 0) - return irq; + if (irq < 0) { + ret = irq; + goto rel_vdev; + } + ret = devm_request_irq(&pdev->dev, irq, emmaprp_irq, 0, dev_name(&pdev->dev), pcdev); if (ret) -- 2.25.1