Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2728106rwo; Thu, 3 Aug 2023 14:05:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlHi64WYkbqFK/8McW/+OjzeTqaQ4Udo8o65BNWe/t16mTNci2FSgvbOcBReIUc24SdVx3aE X-Received: by 2002:a17:902:aa08:b0:1bb:f82f:fb93 with SMTP id be8-20020a170902aa0800b001bbf82ffb93mr13726316plb.2.1691096738386; Thu, 03 Aug 2023 14:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691096738; cv=none; d=google.com; s=arc-20160816; b=yBbBj2mzPR33s/imOuNymAciSPhF1ZmSzT15AxN5866ybbVX9qBKyOVtcmEcn9HuAc 5icA+dSirp5rKpk2yZUYOcuS5wvofUNsgMQrDvKxaGG0s+OIcXHkg9ix9yKOP7NwfvGE MGBrJuElaUpfj9PSzpxI0lzv3fOC4Xjoyzy8XPiNHLqO9WB4MrpLZ4K7rZ3roXr9lxOL C4af8EJvZZr+bMVD2xiqEC+ueJe50bBJrL2wsHLOCv2WPJhB0+ely5bDVI+zaIHoMtBa 58RmIx9jxpqx+4/WmqoA2vdOPUGrkBvW6qFUjpPuqM15EfYl6bPSsaaiEJz7HrLgo1wp zLGg== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=5Qgf85sJxo24YJ/Hz2w1q6OVVERRFRhFo/X+eWoRL8k=; fh=+WZnaKeCH15nyMPTZCG2TtKdgwgWecSJOD5egmIMZI0=; b=inkDGMs4VZWmJtABj1MsLZx3nQuGIaOQ0lY7tD0ueBVJpqXQz1N3FHctUQWsUTCdol QaXJb7wXWTJosjRTqVXbQaUgLrBA1BvzCXosDdXAf2wzC+J0RkzCTKyvrGi4Su9gXXBc XjdT6AURdKeCH5pXYZV/RVBSZp7zPag5vJA68NUJbZJosmPGS2vNr2I57xRZ3Rdoollm qaJj5uEf0Y/kLmUed1CO4o4SwHT/Ldxxy2BVyrikLQpwnZYmAbtNnkm+0b0oXtwyPBjK 2hKZpwvuWGUOa3/OEEL6SizxblLVYiAnS0Yr7N/SpvFIRfVwu4FaUnQYz8LtZPY5vQiQ +38w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=rwGA+VwV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z14-20020a1709027e8e00b001b9d0ad0d40si553056pla.128.2023.08.03.14.05.25; Thu, 03 Aug 2023 14:05:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=rwGA+VwV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbjHCTjl (ORCPT + 99 others); Thu, 3 Aug 2023 15:39:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbjHCTjk (ORCPT ); Thu, 3 Aug 2023 15:39:40 -0400 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52B7F3C3E; Thu, 3 Aug 2023 12:39:31 -0700 (PDT) Received: from localhost.ispras.ru (unknown [10.10.165.2]) by mail.ispras.ru (Postfix) with ESMTPSA id 4FF354076751; Thu, 3 Aug 2023 19:39:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 4FF354076751 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1691091567; bh=5Qgf85sJxo24YJ/Hz2w1q6OVVERRFRhFo/X+eWoRL8k=; h=From:To:Cc:Subject:Date:From; b=rwGA+VwVp+9ulZMMPmsbTKsPCc0swFojp0FahGfB95yHdgb6ubrweROfarleU602L FnGZ+B9/O3IbRCWTyOiXr/GqEhTjzzmKQogBgR2Z6j3fWl9wzxxK4C4oS0lRiVZAVu zsWxlc6snIO4LGbc3gOxJvE0/NQ0DhTzLN+xxx/g= From: Fedor Pchelkin To: Roopa Prabhu Cc: Fedor Pchelkin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Nikolay Aleksandrov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org Subject: [PATCH] drivers: vxlan: vnifilter: free percpu vni stats on error path Date: Thu, 3 Aug 2023 22:38:32 +0300 Message-ID: <20230803193834.23340-1-pchelkin@ispras.ru> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case rhashtable_lookup_insert_fast() fails inside vxlan_vni_add(), the allocated percpu vni stats are not freed on the error path. Free them on the rhashtable_lookup_insert_fast() error path in vxlan_vni_add(). Found by Linux Verification Center (linuxtesting.org). Fixes: 4095e0e1328a ("drivers: vxlan: vnifilter: per vni stats") Signed-off-by: Fedor Pchelkin --- drivers/net/vxlan/vxlan_vnifilter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/vxlan/vxlan_vnifilter.c b/drivers/net/vxlan/vxlan_vnifilter.c index a3de081cda5e..321cd0b450cc 100644 --- a/drivers/net/vxlan/vxlan_vnifilter.c +++ b/drivers/net/vxlan/vxlan_vnifilter.c @@ -740,6 +740,7 @@ static int vxlan_vni_add(struct vxlan_dev *vxlan, &vninode->vnode, vxlan_vni_rht_params); if (err) { + free_percpu(vninode->stats); kfree(vninode); return err; } -- 2.41.0