BigW Consortium Gitlab

Commit 0a1e13ea by Thong Nguyen

ws_eink: clean up resource by free memory and cleanup deferred io

Using vfree instead of kfree because we using vzalloc to allocate memory and aff cleanup deferred io
parent a0e5b5c6
...@@ -606,11 +606,11 @@ static int ws_eink_spi_probe(struct spi_device *spi) ...@@ -606,11 +606,11 @@ static int ws_eink_spi_probe(struct spi_device *spi)
disp_init_fail: disp_init_fail:
framebuffer_release(info); framebuffer_release(info);
fbreg_fail: fbreg_fail:
kfree(par->ssbuf); vfree(par->ssbuf);
ssbuf_alloc_fail: ssbuf_alloc_fail:
vfree(info->screen_base); vfree(info->screen_base);
screen_base_fail: screen_base_fail:
kfree(info->screen_base); vfree(info->screen_base);
return retval; return retval;
} }
...@@ -618,15 +618,10 @@ static int ws_eink_spi_remove(struct spi_device *spi) ...@@ -618,15 +618,10 @@ static int ws_eink_spi_remove(struct spi_device *spi)
{ {
struct fb_info *p = spi_get_drvdata(spi); struct fb_info *p = spi_get_drvdata(spi);
struct ws_eink_fb_par *par = p->par; struct ws_eink_fb_par *par = p->par;
fb_deferred_io_cleanup(p);
unregister_framebuffer(p); unregister_framebuffer(p);
/* vfree(p->screen_base);
* TODO: Why is this necessary? It doesn't seem that there is a call to vfree(par->ssbuf);
* fb_alloc_cmap()
*/
fb_dealloc_cmap(&p->cmap);
iounmap(p->screen_base);
kfree(p->screen_base);
kfree(par->ssbuf);
framebuffer_release(p); framebuffer_release(p);
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment