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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Jul 2023 08:08:57 +0000 (09:08 +0100)
commit7709fbd4922c197efabda03660d93e48a3e80323
tree72936cca36d6c703d7b377b8504e7cd871cec61c
parentaf42088bdaf292060b8d8a00d8644ca7b2b3f2d1
octeontx2-af: Move validation of ptp pointer before its usage

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>
drivers/net/ethernet/marvell/octeontx2/af/ptp.c
drivers/net/ethernet/marvell/octeontx2/af/rvu.c