hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/gpu/drm/rockchip/rockchip_drm_debugfs.c
....@@ -56,7 +56,7 @@
5656 int rockchip_drm_dump_plane_buffer(struct vop_dump_info *dump_info, int frame_count)
5757 {
5858 int flags;
59
- int bpp = 32;
59
+ int bpp;
6060 const char *ptr;
6161 char file_name[100];
6262 int width;
....@@ -70,6 +70,10 @@
7070 drm_get_format_name(dump_info->format->format, &format_name);
7171 strscpy(format, format_name.str, 5);
7272 bpp = rockchip_drm_get_bpp(dump_info->format);
73
+ if (!bpp) {
74
+ DRM_WARN("invalid bpp %d\n", bpp);
75
+ return 0;
76
+ }
7377
7478 if (dump_info->yuv_format) {
7579 u8 hsub = dump_info->format->hsub;