From 11a51b0ef5423ccb86da0fec4c44c476666c0da2 Mon Sep 17 00:00:00 2001 From: Tatenda Chipeperekwa Date: Thu, 11 Jun 2020 12:28:13 -0700 Subject: [PATCH] disp: msm: dp: return -ENODEV when USBPD module is not enabled Return ERR_PTR with -ENODEV when the USBPD module is not enabled. This allows the DP driver to handle the failure correctly and prevents any potential NULL pointer dereferencing in the clean up path. Change-Id: I4fbc559276bebe770a27935243a59c10c1bb5491 Signed-off-by: Tatenda Chipeperekwa --- msm/dp/dp_usbpd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msm/dp/dp_usbpd.h b/msm/dp/dp_usbpd.h index 8fcb855f491e..e56e3a691cd1 100644 --- a/msm/dp/dp_usbpd.h +++ b/msm/dp/dp_usbpd.h @@ -65,7 +65,7 @@ void dp_usbpd_put(struct dp_hpd *pd); static inline struct dp_hpd *dp_usbpd_get(struct device *dev, struct dp_hpd_cb *cb) { - return NULL; + return ERR_PTR(-ENODEV); } static inline void dp_usbpd_put(struct dp_hpd *pd)