[PATCH] drm/bridge:Fix the panic problem caused by bridge->funcs->attach

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When the code is executed to bridge->funcs->attach,bridge->funcs is NULL.
Although the function entry checks whether the bridge pointer is NULL,it
does not detect whether the bridge->funcs is NULL, so a panic error
occurs.

Signed-off-by: logic.yu <hymmsx.yu@xxxxxxxxx>
---
 drivers/gpu/drm/drm_bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index c3d69af02e79..f3dd67fb3f1d 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -302,7 +302,7 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge,
 {
 	int ret;
 
-	if (!encoder || !bridge)
+	if (!encoder || !bridge || !bridge->funcs)
 		return -EINVAL;
 
 	if (previous && (!previous->dev || previous->encoder != encoder))
-- 
2.17.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux