Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp251022pxx; Wed, 28 Oct 2020 04:07:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlve5906DAJ69REagt6O9Cgel9azGSLtHGjmJyJUgV7Nq/dN9Rqcy6c/rTyK4yptPZarUv X-Received: by 2002:aa7:ce8d:: with SMTP id y13mr581902edv.65.1603883237795; Wed, 28 Oct 2020 04:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603883237; cv=none; d=google.com; s=arc-20160816; b=RmQdmcOEPnkDinAFps5rFr/sYQ2qze3joYEKJyGVRst2dOoB0/bg2eNO8YqYO05SO0 b04AhpJPwYpjYGrXLg8ToMpdSfq9ztzheEAACGRYw/4letKjUATPthWd3Wo251xv6bPa soaP0/7HWDIHKebK4g0F5Y6QgTe0hL+khlCB6qSseZux7vukklAttvr9a6TOkY8DPi+Z DAK1ol7zpJNOXphwfeJxuplbFj2JM3t0IkqE0Npviic9ERJ08oczPeteAlvcgApJ+C8+ z8zPjy1nvyb6TjViE+wjQOy+CUTIS0gk9b3NFuyhhKg8EDhflnMMlS6iq5IZQDq1H1/B eGkQ== 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=k6VqRx06ki5v7Cat2RU9lBFopjLSYxOdFwuTZaynmKY=; b=aBwtmXBPV1JXLmlZP+esisfQ4w0f+qMx7TOCz4BGsIKrMx8KsqPcMl7KMFJKrXMINy teHcQFcgNx6LWHUb4i1STjcnzqLcNdhHBk3S/a8TzIIFIZ7j/1YLx0cosUd3UQw9bNUe DmFT+anVtujmPLNYaL6dWNE1Ez3nG4LsnBNUtqEhPNIChBQVrLv4Yok/TJZM0IMoFTxp VTke8f+0IahYQX/IR3mKZ5hAT9jmRmRYYmANQojgA9BC4KaM5F8nkIrpTIuwaJdXmyZc AgHzNLe2FYG/SVwEtpHahPCC9hLsZ2wTFeKxY9Ga/e50+rQwWBlKJaT++IZexXnz2Pw6 PriQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=du995Byi; 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 s16si2897729edy.300.2020.10.28.04.06.55; Wed, 28 Oct 2020 04:07:17 -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=du995Byi; 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 S1786023AbgJ0O7r (ORCPT + 99 others); Tue, 27 Oct 2020 10:59:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:43378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762582AbgJ0One (ORCPT ); Tue, 27 Oct 2020 10:43:34 -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 B76EE206E5; Tue, 27 Oct 2020 14:43:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809813; bh=smJtv4KfydbSkmsiDSlGG1z0Vf1IgmeJiVxaptl62kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=du995ByibKwLgfFLGqPC3VVjX0uKZxmOQkJ/EYNJ8SpmHoTUV2zEl3uJ/4p21Q3MH WCSiNF+FewpxWBVcnCyjbXq5pJDcrubb076onP4DVhut+T45kbSHtM/XL3KNYjSII9 aKd6BswXEdfnXkceUk6kDxFx/D5A3NdtNryQ7LiQ= 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 5.4 329/408] media: firewire: fix memory leak Date: Tue, 27 Oct 2020 14:54:27 +0100 Message-Id: <20201027135510.294066170@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 3f1ca40b9b987..8a8585261bb80 100644 --- a/drivers/media/firewire/firedtv-fw.c +++ b/drivers/media/firewire/firedtv-fw.c @@ -272,8 +272,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