From patchwork Tue Oct 27 13:54:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F125C4363A for ; Tue, 27 Oct 2020 17:23:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 044E021D42 for ; Tue, 27 Oct 2020 17:23:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603819402; bh=smJtv4KfydbSkmsiDSlGG1z0Vf1IgmeJiVxaptl62kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cynijh0a8XQch6ZzE84hjQaVqfRUp0F1pQDA7cuMAsOx+8diuNCTL4z9frq9LtNFZ fuFlVKCH1CMb6I9RInRw63cQQoGiMTZnUCvWHXFEE8kpnfUt0M6FiLtjjo0OLZvDls BTJ5cdjdQs+Qq3q8ZkC5HlBeaGA5JAoRjEuY4VPE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1780428AbgJ0Oyo (ORCPT ); Tue, 27 Oct 2020 10:54:44 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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)