Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp730435ybc; Sat, 16 Nov 2019 07:42:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzlJhfGMH+ys2rQKI6nf2HjSaCriXjAwMWnxvvxoOppn7D4nrzwiVuPRi5YF/j7jmuWN8CY X-Received: by 2002:a17:906:5c4d:: with SMTP id c13mr7324202ejr.80.1573918955749; Sat, 16 Nov 2019 07:42:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573918955; cv=none; d=google.com; s=arc-20160816; b=WqY55VJFQQfLXokQndYx2YqVc5NyI+8Q7j9udd2vekmy9ejhzNXYGv3uc/zpFB5D69 2y4042KRDSliH9JYVwKOxlUEluxgAqlk3wCRd5Y/XvzY8sZoKB29UVsueuu+VFaDAiKh M76DsBfS6S1FYB5mAqgfr1foCo4bPdVRi8psx4wKYavcff+4hLgpWLqejZt7e+cyqXsX M5xTlF4kq9eTwu+ntQDqovPhWvwisc6H6mxR0l1xDmNwiW19L77oT26rEjhws6X16F5a MnWMMBZvgEKKrvT5IkV3vWps1Ivu/T3HKTkizXtLOYmNXpgPftKwMExwp7GehgAOw3QB RIRQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=+LcyjNQsTO0WodYiQpktbpNO3VOSLDJh9G+if0UfLdQ=; b=DUILStc6QzDogZ9CvoohGbvkt+mCxza/YOjoObU6j6vMyi5LGGBXcSd59LN9h+9eNB IKsXZBFrz4HGtJSXFmxPLjVoYJpkRxMNzZlMUnpyuX+/baMMv+x+PV7sQL9vevYZAGlY Y4va+z0YQqWOAjhDgfGaYxHYeUVDpKEsTdv2apGyDZcxrBecjkOPH9Vpt5vaU1I12RB9 82+GXHm4aBggNNThF7/58jsvTXQLBURYkGokTO79fNbhBJCWGTjS4vIQzNumSB5h3u9L c8Ccv2SsaWzdTMi90cXS1vtfTKYgOvMWvDWZNUs72NByvgLcEQMfkpgIDOaklisNlIQP Zi2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YHOUJwzo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pg2si7890865ejb.216.2019.11.16.07.42.10; Sat, 16 Nov 2019 07:42:35 -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=YHOUJwzo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727752AbfKPPlP (ORCPT + 99 others); Sat, 16 Nov 2019 10:41:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:44170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727655AbfKPPlO (ORCPT ); Sat, 16 Nov 2019 10:41:14 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F191320718; Sat, 16 Nov 2019 15:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573918874; bh=8bxpyTayDO1IguOcBDdmMf7HebvpmIjmrxBF6bdJCP0=; h=From:To:Cc:Subject:Date:From; b=YHOUJwzorfLw24mP6SidXkWtgdFaY2rXYWahL5v2AMLebtLbsJjtZmCu8e7WU0XKI 9qqLjQHLyH5e4/KRiRKwbDAVAZo7vNg3gWdGW4G8x6bikHllFbj9ppHv1WBWi615OA +5ZrLZ52h7tgqAwgDsLnDUX7dcCMWTVPz9BPd0eA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Takashi Sakamoto , Takashi Iwai , Sasha Levin Subject: [PATCH AUTOSEL 4.19 001/237] ALSA: isight: fix leak of reference to firewire unit in error path of .probe callback Date: Sat, 16 Nov 2019 10:37:16 -0500 Message-Id: <20191116154113.7417-1-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 30957477e005e..0717ab9e48e3b 100644 --- a/sound/firewire/isight.c +++ b/sound/firewire/isight.c @@ -640,7 +640,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); @@ -669,12 +669,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