fbinfo->fbops = &bfin_bf54x_fb_ops;
 
-       fbinfo->pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL);
+       fbinfo->pseudo_palette = devm_kzalloc(&pdev->dev, sizeof(u32) * 16,
+                                             GFP_KERNEL);
        if (!fbinfo->pseudo_palette) {
                printk(KERN_ERR DRIVER_NAME
                       "Fail to allocate pseudo_palette\n");
                       "Fail to allocate colormap (%d entries)\n",
                       BFIN_LCD_NBR_PALETTE_ENTRIES);
                ret = -EFAULT;
-               goto out5;
+               goto out4;
        }
 
        if (request_ports(info)) {
        free_ports(info);
 out6:
        fb_dealloc_cmap(&fbinfo->cmap);
-out5:
-       kfree(fbinfo->pseudo_palette);
 out4:
        dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer,
                          info->dma_handle);
                dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer,
                                  info->dma_handle);
 
-       kfree(fbinfo->pseudo_palette);
        fb_dealloc_cmap(&fbinfo->cmap);
 
 #ifndef NO_BL_SUPPORT