]> git.baikalelectronics.ru Git - kernel.git/commit
ionic: fix memory leak of object 'lid'
authorColin Ian King <colin.king@canonical.com>
Wed, 22 Jul 2020 17:40:03 +0000 (18:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Jul 2020 01:10:09 +0000 (18:10 -0700)
commit8cd5198b0b2eb357d7fbfc131763292dc174a6aa
tree02b9513e968d1dc2cb80e8abbc8bf8c1741679d9
parent9c84db02b53527b1120d60ba09551b06666e2410
ionic: fix memory leak of object 'lid'

Currently when netdev fails to allocate the error return path
fails to free the allocated object 'lid'.  Fix this by setting
err to the return error code and jumping to a new label that
performs the kfree of lid before returning.

Addresses-Coverity: ("Resource leak")
Fixes: aeea042a823b ("ionic: get MTU from lif identity")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_lif.c