From patchwork Tue Sep 15 14:12:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 309663 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=-15.7 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 6FE69C31E49 for ; Tue, 15 Sep 2020 23:34:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2FEA52193E for ; Tue, 15 Sep 2020 23:34:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600212884; bh=DV7gGrRAoLENF14ze7dE4iENAKav/G+BIt/ovTdJumY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oEQFS2zNbNZqotBLX2Z0CNcu8xhBvj/BX9a+JiifLUXteXk6wI+MMxxBt4ruElF08 8+xowAI72YNaV44Z6DAaEo1R1fu43OvkDiReOjF3X2BHOwBaIDRfDwf/HG9qglzmO+ R2gV/lL585ikC+9FnnZ8+eYODWjSkRxNvgryIQDI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727484AbgIOXem (ORCPT ); Tue, 15 Sep 2020 19:34:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:46456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727157AbgIOOgT (ORCPT ); Tue, 15 Sep 2020 10:36:19 -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 CFA1C223C8; Tue, 15 Sep 2020 14:26:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179997; bh=DV7gGrRAoLENF14ze7dE4iENAKav/G+BIt/ovTdJumY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u/I+1h6CxDJivZ97o0AW1IUdJH0nGt0Ca7cJ/G/D0jRXXxAYBkUHNkyNt+ioB0T// IHHui5YCZjiDBD5EfjB4ndc15lIbeadLxzf/2nJWA+zL06yfnyrplLX3OG62D+v2ED gcxz2OG9WG92HSrehBTfZ7FXyHhqXN/JYrSbvVi4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , "David S. Miller" , Sasha Levin Subject: [PATCH 5.8 068/177] firestream: Fix memleak in fs_open Date: Tue, 15 Sep 2020 16:12:19 +0200 Message-Id: <20200915140656.892788108@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140653.610388773@linuxfoundation.org> References: <20200915140653.610388773@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dinghao Liu [ Upstream commit 15ac5cdafb9202424206dc5bd376437a358963f9 ] When make_rate() fails, vcc should be freed just like other error paths in fs_open(). Signed-off-by: Dinghao Liu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/atm/firestream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index cc87004d5e2d6..5f22555933df1 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c @@ -998,6 +998,7 @@ static int fs_open(struct atm_vcc *atm_vcc) error = make_rate (pcr, r, &tmc0, NULL); if (error) { kfree(tc); + kfree(vcc); return error; } }