Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3529743pxb; Mon, 1 Mar 2021 12:25:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyI1RFEcz6YUyXVd2vNxLf0aiDPWTFROtL/IbIF5FdOrJmxSNjsqg99K7ex+MzEvWwqXx03 X-Received: by 2002:a05:6402:888:: with SMTP id e8mr10362334edy.51.1614630348454; Mon, 01 Mar 2021 12:25:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614630348; cv=none; d=google.com; s=arc-20160816; b=kssPNwRpxVEqWdWMmYhI0jet4SQHM4OA9sBfphL1RtxG18i1VrNHl0ZJqMeKfYzy3f zdD8CxYYx2OtQgPmVZJ5Q670Nxw8wZB6NNmEw88Hf6LIAZzZQfEaKOywf923v1mjk/5c E0Zj2KMhjeJKwfQCHtrZehDnSy4QL1fhsRtxRENftrpILpt6eHDIgMb6AdYs+H+qWfsN X9vWuOqSo1FrPEuKZ/rXUh5YMhie8i6Krua6DvT7l24DJQANTiSlvvuksP+XtHSNXzD6 chIfLmVAenQiR5XS7uRpKHxxO5JF44YvtvMWdJhjLdqi/tlvywaxVApmtPec4vTeVVXj +KWA== 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=X+rz5fXlrGDAv8oneoLTarW6nHbYwdSumA32E69Dv2Q=; b=R4P6Y/wjVnKEa08ewlueSqHhgnKP9Dc/fhBwLoov1E5DAM0fNCjkVujX1qiuxzrv+G 5d4/kx4LiqpcroB4+TOB3JySdSdwtQpxC0+HqpYGax2R9wivUu7qxOwo9nGp5Wm2SmrZ goFP6es2gIvWm1viBEGN79Dpt/5txWvcZTnKisEYo9OA0w33LO2NFOgK+JX9eB7ovmtG q9E6HrVWM++Qs3X5zL6DHigi3N4Du6Op5vBmX8Ae/yymll1VreTJki+xfQFukCXc74xU B4nObMXUrI4Z7gWbgir/T7J3eZU3aji094EsWtvqLNc9Hz6Hrlq7nEcoU2SJANpFB4Iv EOig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wTbFYjQn; 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=pass (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 ze11si4372545ejb.434.2021.03.01.12.25.25; Mon, 01 Mar 2021 12:25:48 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=wTbFYjQn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238771AbhCAUUI (ORCPT + 99 others); Mon, 1 Mar 2021 15:20:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:35314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236609AbhCAREU (ORCPT ); Mon, 1 Mar 2021 12:04:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EEA0C64F76; Mon, 1 Mar 2021 16:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616755; bh=BMVS0Tuv0et6t3zacWxFKjEn0NTFs5SZ2LN4WdAehCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wTbFYjQnlNSz36BUPI3MK5h+vIlcOqJykaEZYOdFiQ0g9FV81Iok30t9HqVp/gjaH /SjdYTp5TA9qhjjTUeqdq0Tk4ClAzgzv7ktRz3CJU7HjLsgq4PJvb1owTcCBEbUfF2 PLEOfQHPzWRWWsfT965gCINWfS+rT+SJbfSQW16o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.19 084/247] media: media/pci: Fix memleak in empress_init Date: Mon, 1 Mar 2021 17:11:44 +0100 Message-Id: <20210301161035.788556141@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@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 15d0c52241ecb1c9d802506bff6f5c3f7872c0df ] When vb2_queue_init() fails, dev->empress_dev should be released just like other error handling paths. Fixes: 2ada815fc48bb ("[media] saa7134: convert to vb2") Signed-off-by: Dinghao Liu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/pci/saa7134/saa7134-empress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/saa7134/saa7134-empress.c b/drivers/media/pci/saa7134/saa7134-empress.c index 66acfd35ffc60..8680eb08b654d 100644 --- a/drivers/media/pci/saa7134/saa7134-empress.c +++ b/drivers/media/pci/saa7134/saa7134-empress.c @@ -293,8 +293,11 @@ static int empress_init(struct saa7134_dev *dev) q->lock = &dev->lock; q->dev = &dev->pci->dev; err = vb2_queue_init(q); - if (err) + if (err) { + video_device_release(dev->empress_dev); + dev->empress_dev = NULL; return err; + } dev->empress_dev->queue = q; video_set_drvdata(dev->empress_dev, dev); -- 2.27.0