Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5980047ybc; Wed, 27 Nov 2019 12:49:07 -0800 (PST) X-Google-Smtp-Source: APXvYqzQ+IuU2gOQ8lFKKhLsdRd06ZliG0bKQE+cYVcmTLLizIC4xptVKxE1JVnEVBCYHm+zTZQk X-Received: by 2002:a05:6402:78b:: with SMTP id d11mr33606054edy.92.1574887746925; Wed, 27 Nov 2019 12:49:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574887746; cv=none; d=google.com; s=arc-20160816; b=FaNO1BPmkX+wKpawcOZEP/bfGMd0Nyo5Yp3JVWMmk9of+VLEYwAbrqZbNQzMwxmkS7 3oWs9Myh5C0riGZs0WXO9RRPKvwiwmEPzXfG9oF27YgLuPpZVVJkooJQUOus+51wQANG UT8aUSXJ5DuDo42HBU121f2xoHESlJwpLm2tY3xlE6spb2EfCa1FpRua1wGI77i00/na Qap08tkd1dX+FdNhzexBDNlWbskkEBfGvNfq64YLI8ZlOS4TCzUkYK/w5G0IOXKUEfq6 /rGYh61B13VspJg/GT6MXeWxZHvyGAeQnt9GWk+lZDs5r93b9Z0Xoe1Zbs8uKW+SzBdx Jh0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=P1JmfZcgn60YnBBtbYiz0Da8UeXkXOtcSKOrvAGv6ns=; b=lRkf+bg3MhptIB2pFZbI/TNMb/lUDVJ/0LzTh0Y4IiXJu1VgcGg5CXUuMQH1WLukS4 nA33lt4xigcQi/ET0ZHJYR1wYit7+ykiQiLiiM/M9qKKA0T+HOnJ8XZ5GYbWXgxfTXMV cPOhL5BCPa5LtIrg0MneW7ZSObfB/uSRHaZteRZkTARYXzOnshG0A6l3Aqpan6be33AS DJY81LClUmIiWbC5tBDAmNLK4DxD8i7K/XuZ4+kX5ms4lPenluUZD0QqoFb8pfbE8pK1 PJYbhb7tfc0y/LsQPDBoujMZlypcxYRNuyAjbp2DOCbex1GnaY9R94HlLi6ivsfbUVr1 42IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KBczJEdx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o64si91267eda.150.2019.11.27.12.48.43; Wed, 27 Nov 2019 12:49:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KBczJEdx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729888AbfK0Uqb (ORCPT + 99 others); Wed, 27 Nov 2019 15:46:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:58422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729876AbfK0Uq3 (ORCPT ); Wed, 27 Nov 2019 15:46:29 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 D55ED2158A; Wed, 27 Nov 2019 20:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574887588; bh=FknDXqjToftO/T1ZTrO4rNNhR0VU4cU3YPNxDSoszY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBczJEdxH+mCh+TuKeMD24AJ7Ny9Sj9hXZd65PP3moYy+klkapS6UR7ENXDp7cBrv Q2G9hfxJRmg2dawUG0hlZjncJJ1GSxwZOr7vm72Wb+KZAdm1pSAnO+3N3XAfbf033f j6KziNynYqkYtmildzP1tJqvduHZp9yr7BkHCQHk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Sakamoto , Takashi Iwai , Sasha Levin Subject: [PATCH 4.14 018/211] ALSA: isight: fix leak of reference to firewire unit in error path of .probe callback Date: Wed, 27 Nov 2019 21:29:11 +0100 Message-Id: <20191127203052.656103970@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203049.431810767@linuxfoundation.org> References: <20191127203049.431810767@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Sakamoto [ Upstream commit 51e68fb0929c29e47e9074ca3e99ffd6021a1c5a ] In some error paths, reference count of firewire unit is not decreased. This commit fixes the bug. Fixes: 5b14ec25a79b('ALSA: firewire: release reference count of firewire unit in .remove callback of bus driver') Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/firewire/isight.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c index 5826aa8362f10..9edb26ab16e90 100644 --- a/sound/firewire/isight.c +++ b/sound/firewire/isight.c @@ -639,7 +639,7 @@ static int isight_probe(struct fw_unit *unit, if (!isight->audio_base) { dev_err(&unit->device, "audio unit base not found\n"); err = -ENXIO; - goto err_unit; + goto error; } fw_iso_resources_init(&isight->resources, unit); @@ -668,12 +668,12 @@ static int isight_probe(struct fw_unit *unit, dev_set_drvdata(&unit->device, isight); return 0; - -err_unit: - fw_unit_put(isight->unit); - mutex_destroy(&isight->mutex); error: snd_card_free(card); + + mutex_destroy(&isight->mutex); + fw_unit_put(isight->unit); + return err; } -- 2.20.1