Skip to contentSkip to conversation

drm: sun4i: Add composite output

DISCUSSION Dan Carpenter 1 participant 1 message May 12, 2016

lore
Share & tools
lore
#0 lore raw

Hello Maxime Ripard,

The patch 03c4c71d25b4: "drm: sun4i: Add composite output" from Oct 29, 2015, leads to the following static checker warning:

	drivers/gpu/drm/sun4i/sun4i_tv.c:513 sun4i_tv_comp_get_modes()
	error: potential null dereference 'mode'.  (drm_mode_create returns null)

drivers/gpu/drm/sun4i/sun4i_tv.c
505 static int sun4i_tv_comp_get_modes(struct drm_connector *connector) 506 {
507 int i;
508
509 for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {

   510                  struct drm_display_mode *mode = drm_mode_create(connector->dev);
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   511                  struct tv_mode *tv_mode = &tv_modes[i];
   512  
   513                  strcpy(mode->name, tv_mode->name);
                               ^^^^^^^^^^

514
515 sun4i_tv_mode_to_drm_mode(tv_mode, mode);
516 drm_mode_probed_add(connector, mode);
517 }
518
519 return i;
520 }

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel