答复: [RESEND 1/3] drm: fsl-dcu: Fix no fb check bug

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

 



Tested-by: Meng Yi <meng.yi@xxxxxxx>

-----邮件原件-----
发件人: Dongsheng Wang [mailto:Dongsheng.Wang@xxxxxxxxxxxxx] 
发送时间: Tuesday, December 01, 2015 4:16 PM
收件人: airlied@xxxxxxxx
抄送: stefan@xxxxxxxx; dri-devel@xxxxxxxxxxxxxxxxxxxxx; Jianwei Wang <jianwei.wang.chn@xxxxxxxxx>; Yi Meng-B56799 <B56799@xxxxxxxxxxxxx>; Wang Dongsheng-B40534 <Dongsheng.Wang@xxxxxxxxxxxxx>
主题: [RESEND 1/3] drm: fsl-dcu: Fix no fb check bug

From: Jianwei Wang <jianwei.wang.chn@xxxxxxxxx>

For state->fb may be NULL in fsl_dcu_drm_plane_atomic_check function, if so, return -EINVAL. No need check in fsl_dcu_drm_plane_atomic_update anymore.

Signed-off-by: Jianwei Wang <jianwei.wang.chn@xxxxxxxxx>
Signed-off-by: Yi Meng <b56799@xxxxxxxxxxxxx>
Signed-off-by: Wang Dongsheng <dongsheng.wang@xxxxxxxxxxxxx>
Tested-by: Stefan Agner <stefan@xxxxxxxx>

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
index 51daaea..a8932a8 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
@@ -41,6 +41,9 @@ static int fsl_dcu_drm_plane_atomic_check(struct drm_plane *plane,  {
 	struct drm_framebuffer *fb = state->fb;
 
+	if (!fb)
+		return -EINVAL;
+
 	switch (fb->pixel_format) {
 	case DRM_FORMAT_RGB565:
 	case DRM_FORMAT_RGB888:
@@ -85,9 +88,6 @@ static void fsl_dcu_drm_plane_atomic_update(struct drm_plane *plane,
 	unsigned int alpha, bpp;
 	int index, ret;
 
-	if (!fb)
-		return;
-
 	index = fsl_dcu_drm_plane_index(plane);
 	if (index < 0)
 		return;
--
2.1.0.27.g96db324

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[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