drm: sun4i: Add composite output

Dan Carpenter dan.carpenter at oracle.com
Thu May 12 09:59:06 UTC 2016


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


More information about the dri-devel mailing list