Messages in this thread Patch in this message | | | From | Fedor Pchelkin <> | Subject | [PATCH] drivers: vxlan: vnifilter: free percpu vni stats on error path | Date | Thu, 3 Aug 2023 22:38:32 +0300 |
| |
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 <pchelkin@ispras.ru> --- 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
| |