Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp163408pxx; Wed, 28 Oct 2020 01:14:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZ4buFkWWmahP0L7wstMlwernqyvjb6jA5aToV6Zj6+ltkqtFHMO4qrcMG+PpqGGuO/9Di X-Received: by 2002:a17:906:4351:: with SMTP id z17mr6343524ejm.110.1603872850782; Wed, 28 Oct 2020 01:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603872850; cv=none; d=google.com; s=arc-20160816; b=kj7wigDQ9o8sxv7u7jO/gynzkaBjz6AXRUok9KjnzlRRHSv0au5FD8kHMr3gXhAoWd wXhWrnwn8zThY6fLuNlwjkzkmWxABkZoFZtslxGMeUDZvoAByFOzUieLgVVl11OnTmjf MHWlLe28D9TciKpHC8sY3ISKfOHyR53O9k+BEFnDoGlYpKc1k+80SOQbrpYvYWtHhVhT +ZVg/+A1MU5Gw6wbVlq1GSBazB/yJJBoKRuKChsGh3vjutWNsI9GARYt3h2NiRuurGZe +DSnJo5YjS8mGYx0P4gZDvgEjHXf3+5MmUGucB013M1+bFKtwb081oshmYiS4453Qo8l fB1A== 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=W6iXwKt5nur8ztl4pqpmYh5TnZKRXhp4cvCqsg/QSj4=; b=ZzAEG8t79FOHeaYU8njlTbDcpt1flebyAsyVYvyoYq7ucSlEidd+E2G4hALjZ4fGaK IkdIauSZLPnClKYMR+LZPfV1ovczq3g95bZeOqkqkUoaqYCTheJsHTUgJ7l8EWlZCBF6 kCK1WmW0eE9qicVAHFiC9zqGv1WiqZgq7mI7m36AGJFYrqXv9iVmnaNqRUY27GwmufIQ pq7lIRqFrYijg0v0IV0ZYQjJpDye8vcED3abQcR+YNyhZEay5gTpoDKFce8qLY0jBXn0 WCVFDaFQ4fG9SfZ0DQFJx8xFeHHs+nv8LYNRyod22AAOO26liUVhz4dwAdsVeahOiVTG VZqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zjOM+NE1; 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 a42si3838927edf.535.2020.10.28.01.13.48; Wed, 28 Oct 2020 01:14:10 -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=zjOM+NE1; 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 S2504351AbgJ0OAj (ORCPT + 99 others); Tue, 27 Oct 2020 10:00:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:47384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753292AbgJ0N7y (ORCPT ); Tue, 27 Oct 2020 09:59:54 -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 8E530221F8; Tue, 27 Oct 2020 13:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807193; bh=3BpnqO3HAOZZuIA352xBin6HwuuJeAgKkuyK8XOP52w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zjOM+NE1Yot2LEIkBWLPLrijQVNhqge3tPg9AXuqPOgFUovw+3bt5w53bMNMI7oXg 2hIMucEFoEW5kF7zjB5bu2BWS9w0rVPiq1x1BnVdJ/wFFRQKTqo9x+0Lf9+tybCd+z 15wC2d7bfzLRTOQHqgWSvGprMoDpd5TH55fI/VNs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Pavel Machek (CIP)" , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.4 077/112] media: firewire: fix memory leak Date: Tue, 27 Oct 2020 14:49:47 +0100 Message-Id: <20201027134904.193320956@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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: Pavel Machek [ Upstream commit b28e32798c78a346788d412f1958f36bb760ec03 ] Fix memory leak in node_probe. Signed-off-by: Pavel Machek (CIP) Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/firewire/firedtv-fw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/firewire/firedtv-fw.c b/drivers/media/firewire/firedtv-fw.c index 5d634706a7eaa..382f290c3f4d5 100644 --- a/drivers/media/firewire/firedtv-fw.c +++ b/drivers/media/firewire/firedtv-fw.c @@ -271,8 +271,10 @@ static int node_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) name_len = fw_csr_string(unit->directory, CSR_MODEL, name, sizeof(name)); - if (name_len < 0) - return name_len; + if (name_len < 0) { + err = name_len; + goto fail_free; + } for (i = ARRAY_SIZE(model_names); --i; ) if (strlen(model_names[i]) <= name_len && strncmp(name, model_names[i], name_len) == 0) -- 2.25.1