Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp192121pxx; Wed, 28 Oct 2020 02:16:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZue1zyQzX8KOSRURrKqSHnwUEj6RbUCcxKEvlDs+TJ7tboAX/tHXRUJHSkbpiKjS+VQce X-Received: by 2002:a17:906:5509:: with SMTP id r9mr6762624ejp.12.1603876607400; Wed, 28 Oct 2020 02:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603876607; cv=none; d=google.com; s=arc-20160816; b=aRl0U5VQ/UbZm/XFZMFMG2pFCcjuEIPpWyJhuOR3RJOlwYw0HNzx3rYW5toyO50SPh owL3pANfasZFgApVDBZy1kGYtd3PCDPVD/A5cmcLG4CrEZJ4MGKYPXlfeIntu5zuHnoS tgPhaJB8VObQozBoYU+69K2I2D3edGO1WJMd5dyTAAVg7gY+lBmzcPFT5NEqHsfvQD95 dGhLFG5JnFBeGloyHednHJT8af0WdstBdelYNruk1kzFDJYCk6/nKWVE74p6OngG5JEk xWuDkKHyKqytVVl8uCcHfsf+HliylL+ryhkmeXQsCSxMwQvo4lQukLPhFWewRPK03rDn P7vA== 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=CSU6Yd8LInfmb+cyWEXsLiBtgVtsv78i26vVJG5831A3aePrnWpxh4Ahmg+Y3so3nv S3ZNEjQR+e+VrAX/RAoEBspOEX45/kq/RdP1K6aN/+5ZJ7mH4bz8UGzW/BWoVL/xvMGR eTYknct5J63eepdzads1uFxRpBi9qVof+Q9kWAQwAF4opI/hIDL1NvIy9pBK11YFHjAD AH4XSZ9GbDKhlO3ylQMXcCnhXsrTETlpEfNS2NxOSVXAKQmildkIsyHTzfCbwBUlsH20 RtSecV0aOir/uTIMe4F+1rR5B7lHVFhqaJ20XokXwStgb996OpUmpZoJD3lVcMNDoS3B YBUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RVC3Ol38; 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 o10si2705925ejr.482.2020.10.28.02.16.25; Wed, 28 Oct 2020 02:16:47 -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=RVC3Ol38; 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 S2901049AbgJ0OSQ (ORCPT + 99 others); Tue, 27 Oct 2020 10:18:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:36560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754347AbgJ0OOy (ORCPT ); Tue, 27 Oct 2020 10:14: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 DEEA8206F7; Tue, 27 Oct 2020 14:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808094; bh=3BpnqO3HAOZZuIA352xBin6HwuuJeAgKkuyK8XOP52w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RVC3Ol38OdpRfp8QXaqUSUEn+2sWhXxckC6lxwDwm5whwdO2F0CMPFgYsjudj885S ztIbHl5HJqbBZXRmKO9hDoZqvA8R8jSpkr27btgzQ2FlF9Q/S6QJe4LC+QOMrIzySD qj4vRDUUJJ6dLu54kmFhJzwdXEon+f2YYZqJhC3A= 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.14 137/191] media: firewire: fix memory leak Date: Tue, 27 Oct 2020 14:49:52 +0100 Message-Id: <20201027134916.294694879@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@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