[bug report] drm/komeda: Add writeback support

james qian wang (Arm Technology China) james.qian.wang at arm.com
Mon Aug 19 07:11:44 UTC 2019


On Wed, Aug 14, 2019 at 05:09:30PM +0300, Dan Carpenter wrote:
> Hello james qian wang (Arm Technology China),
> 
> The patch 5d51f6c0da1b: "drm/komeda: Add writeback support" from May
> 23, 2019, leads to the following static checker warning:
> 
> 	drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c:151 komeda_wb_connector_add()
> 	error: not allocating enough data 1592 vs 1584
> 
> drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
>    139  static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
>    140                                     struct komeda_crtc *kcrtc)
>    141  {
>    142          struct komeda_dev *mdev = kms->base.dev_private;
>    143          struct komeda_wb_connector *kwb_conn;
>    144          struct drm_writeback_connector *wb_conn;
>    145          u32 *formats, n_formats = 0;
>    146          int err;
>    147  
>    148          if (!kcrtc->master->wb_layer)
>    149                  return 0;
>    150  
>    151          kwb_conn = kzalloc(sizeof(*wb_conn), GFP_KERNEL);
>                                            ^^^^^^^
> This should probably be "kwb_conn" with a k?

Hi Dan:

Thank you very much, I'll correct it ASAP.

BTW:
Seems this error had been detected by a static parser, if possible
can you share your tools or your command for how to catch such problem

thanks
James.

>    152          if (!kwb_conn)
>    153                  return -ENOMEM;
>    154  
>    155          kwb_conn->wb_layer = kcrtc->master->wb_layer;
>    156  
>    157          wb_conn = &kwb_conn->base;
>    158          wb_conn->encoder.possible_crtcs = BIT(drm_crtc_index(&kcrtc->base));
>    159  
>    160          formats = komeda_get_layer_fourcc_list(&mdev->fmt_tbl,
>    161                                                 kwb_conn->wb_layer->layer_type,
>    162                                                 &n_formats);
> 
> regards,
> dan carpenter


More information about the dri-devel mailing list