From patchwork Tue Oct 27 13:49:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312994 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=ham 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 0F6F9C388F9 for ; Tue, 27 Oct 2020 14:15:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B54E22222C for ; Tue, 27 Oct 2020 14:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808102; bh=3BpnqO3HAOZZuIA352xBin6HwuuJeAgKkuyK8XOP52w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0QwCknO+gHWzMQTQPYjny39QGeqSgcs9Dr4zQq9iO+NZCrS/HY9NyUoTMmt9VloGH eovEdOo3mmFx+C/rgDIH2t79nGjFtq4T3YNAUxrdMEUisR0sepDh+PbK0XlSYyyRt4 lw/UJB1D3l9Vt9FY5V/JC5vt6Gx/wCzxgzP9Mv7Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755466AbgJ0OO6 (ORCPT ); Tue, 27 Oct 2020 10:14:58 -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 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 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)