The Messenger of Allah ﷺ said, "Whoever keeps a dog, other than a hunting dog or a livestock dog, two qirats are deducted from his good deeds each day."
أن رسول الله ﷺ قال: من اقتنى كلبا إلا كلبا ضاريا، أو كلب ماشية، نقص من عمله كل يوم قيراطان.
Malik narrated it in Istidan (13), from Nafi, from Abdullah bin Umar, as mentioned.Bukhari narrated it in Dhabaih (5482), and Muslim in Musaqah (1574), both of them via Malik, with the same wording.