On Wed, Dec 13, 2023 at 04:47:09PM +0100, Maxime Ripard wrote:
> On Tue, Nov 28, 2023 at 10:51:27AM +0000, Biju Das wrote:
> > +int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
> > +                 unsigned int crtcs)
> > +{
> > +   struct rzg2l_du_device *rcdu = vsp->dev;
> > +   struct platform_device *pdev;
> > +   unsigned int num_crtcs = hweight32(crtcs);
> > +   unsigned int num_planes = 2;
> > +   unsigned int i;
> > +   int ret;
> > +
> > +   /* Find the VSP device and initialize it. */
> > +   pdev = of_find_device_by_node(np);
> > +   if (!pdev)
> > +           return -ENXIO;
> > +
> > +   vsp->vsp = &pdev->dev;
> > +
> > +   ret = drmm_add_action_or_reset(&rcdu->ddev, rzg2l_du_vsp_cleanup, vsp);
> > +   if (ret < 0)
> > +           return ret;
> > +
> > +   ret = vsp1_du_init(vsp->vsp);
> > +   if (ret < 0)
> > +           return ret;
> > +
> > +   vsp->planes = kcalloc(num_planes, sizeof(*vsp->planes), GFP_KERNEL);
> > +   if (!vsp->planes)
> > +           return -ENOMEM;
> 
> drmm_kcalloc or drmm_kmalloc_array

Also, it doesn't look like you're using that array anywhere once the
action is gone.

Maxime

Attachment: signature.asc
Description: PGP signature

Reply via email to