Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp173419pxx; Wed, 28 Oct 2020 01:34:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQglzTRAc32FSSzpUIjlpBsECahYQzV2fHJm6n7MRav5eoSyyXEzm4+4OFNPJHGcnvJ3HU X-Received: by 2002:a17:906:abce:: with SMTP id kq14mr6759836ejb.411.1603874087744; Wed, 28 Oct 2020 01:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603874087; cv=none; d=google.com; s=arc-20160816; b=sdXrmI5Lbp13+DwrrMwI2+D1g68+5hQ+41G0ArRu5A6KfbPUufo7+x/iZDvH6ZslMv EbwDwauwfabcZB05Sno1UKcSWhEpC9njaBHZVefrOHVddT+TtkTizI4BwaaXiFnM4gRx MRYZKNWMP7A2IE7wAOXUogDS9VJRqXnJiBSFkgt/ftFQCo6RvB23Na46gKhhTbrHWKe+ DrMdTyz3ekcLDkpKA2IT9qPgdS78NKi6GmQZzuW+t51UAPme2tt808mtGcW9bz8hHGj/ vuhHzV5WxIQUzYD1oS48d14MesX8GoseNOQ9u4cjz4F8C93lph5VnjUVt+q8BmHkd//N fDRg== 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=NhnDKZh3H8LaapO8hNu08UJl46rzZKyw/DZdQH/LlyeUG07GcFKmdC2EnKmBqosNtM ZkCa+z/xPJUKhfyoh6cJV7zxd6yqAXjvwJfFZ5VgXYgisRCt1kxEDJeTsVG5KXFxM+6M UPQ14jgZ36WCTKjY6vaLe8A962CzOV2nuMPFkDbNamTnkdEiE6HObQhiD9Fxe9JVLp/M ETHII2ysKDq6UYuH34yLQckJORH2VnbLpRTTAwSpKp9PaYkghQHL3vtP3f6AlvkMdcX1 oYaihInXDREHPNVMJDhvyEklHxdISwag7YrBckKjtCvb2b4Zvj57dlhkiZfGDVBR57WR xn/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g5pUl9RS; 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 gf17si2900638ejb.226.2020.10.28.01.34.25; Wed, 28 Oct 2020 01:34: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=g5pUl9RS; 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 S1754574AbgJ0OGB (ORCPT + 99 others); Tue, 27 Oct 2020 10:06:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:54318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754559AbgJ0OF7 (ORCPT ); Tue, 27 Oct 2020 10:05:59 -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 1922522264; Tue, 27 Oct 2020 14:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807558; bh=3BpnqO3HAOZZuIA352xBin6HwuuJeAgKkuyK8XOP52w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g5pUl9RSj4cZAstqykAGl6p120atG2KwVfoyLuMmJFObRRUoUw3rq2Gs6tDYRYm/Z D8UHQiLcK7RHRAwJxqiDNIIa22Ss46c+/pwkNa+o4Q/JcoHvWsJGv93miNhCqiIOnU cgLBZv56r10sw0b7LFAkOIIdGRuv+uU97pdfIT9U= 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.9 095/139] media: firewire: fix memory leak Date: Tue, 27 Oct 2020 14:49:49 +0100 Message-Id: <20201027134906.644012192@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@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