From: Claudiu Manoil Date: Thu, 9 May 2019 03:07:12 +0000 (+0000) Subject: ptp_qoriq: fix NULL access if ptp dt node missing X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7f4399ba405b6201fb318b43091703a34b1489ab;p=openwrt%2Fstaging%2Fblogic.git ptp_qoriq: fix NULL access if ptp dt node missing Make sure ptp dt node exists before accessing it in case of NULL pointer call trace. Signed-off-by: Claudiu Manoil Signed-off-by: Yangbo Lu Acked-by: Richard Cochran Signed-off-by: David S. Miller --- diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c index 53775362aac6..e10642403b25 100644 --- a/drivers/ptp/ptp_qoriq.c +++ b/drivers/ptp/ptp_qoriq.c @@ -467,6 +467,9 @@ int ptp_qoriq_init(struct ptp_qoriq *ptp_qoriq, void __iomem *base, unsigned long flags; u32 tmr_ctrl; + if (!node) + return -ENODEV; + ptp_qoriq->base = base; ptp_qoriq->caps = *caps;