]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nfp: freeing the wrong variable
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 12 Jul 2017 07:42:06 +0000 (10:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Jul 2017 15:18:14 +0000 (08:18 -0700)
We accidentally free a NULL pointer and leak the pointer we want to
free.  Also you can tell from the label name what was intended.  :)

Fixes: abfcdc1de9bf ("nfp: add a stats handler for flower offloads")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/metadata.c

index fec0ff2ca94f608a85243a830bb29c226a26ae3c..3226ddc55f99bedbbe013100e708d58c42c6d19c 100644 (file)
@@ -419,7 +419,7 @@ int nfp_flower_metadata_init(struct nfp_app *app)
        return 0;
 
 err_free_last_used:
-       kfree(priv->stats_ids.free_list.buf);
+       kfree(priv->mask_ids.last_used);
 err_free_mask_id:
        kfree(priv->mask_ids.mask_id_free_list.buf);
        return -ENOMEM;