octeontx2-af: Move validation of ptp pointer before its usage
authorSai Krishna <saikrishnag@marvell.com>
Thu, 6 Jul 2023 08:29:36 +0000 (13:59 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jul 2023 11:49:22 +0000 (13:49 +0200)
commit6cc293d29c8fc18cec2e6714be1dc6a56296e5e0
treebb52d4ca9946e80714dbdb7b926dc876fd916073
parentbb56b7905b7d3647450bd024f8daf2b917873af8
octeontx2-af: Move validation of ptp pointer before its usage

[ Upstream commit 7709fbd4922c197efabda03660d93e48a3e80323 ]

Moved PTP pointer validation before its use to avoid smatch warning.
Also used kzalloc/kfree instead of devm_kzalloc/devm_kfree.

Fixes: 2ef4e45d99b1 ("octeontx2-af: Add PTP PPS Errata workaround on CN10K silicon")
Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: Sai Krishna <saikrishnag@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/ptp.c
drivers/net/ethernet/marvell/octeontx2/af/rvu.c