Answer
(Fatwa: 435/361/B=1433)
It was cruelty to hit your child in the state of salah. You committed fault. The salah was invalid and it is necessary to re-offer that salah. If your son is immature then taubah and istighfar is enough for you but the taubah should be with the intention that you would never commit such things in future. And if your son is adult then you should ask him for forgiveness and then do taubah and istighfar. And in no case kaffarah is wajib on you.
Allah (Subhana Wa Ta’ala) knows Best
Darul Ifta,
Darul Uloom Deoband