octeontx2-pf: Fix a memleak otx2_sq_init
authorZhipeng Lu <alexious@zju.edu.cn>
Thu, 1 Feb 2024 12:47:13 +0000 (20:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2024 18:10:49 +0000 (19:10 +0100)
commit76ce07eb215d36c87a17c50ce96ed216bddd4926
tree3a693071db46fd28cab7b04996d06723c9190fa0
parentf9d5410d8f1b3e189fa931cd4bec142c8934cc29
octeontx2-pf: Fix a memleak otx2_sq_init

[ Upstream commit b09b58e31b0f43d76f79b9943da3fb7c2843dcbb ]

When qmem_alloc and pfvf->hw_ops->sq_aq_init fails, sq->sg should be
freed to prevent memleak.

Fixes: c9c12d339d93 ("octeontx2-pf: Add support for PTP clock")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Acked-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c