staging: fbtft: Fix potential null dereference

This error is found by smatch tool.

Signed-off-by: Madhusudhanan Ravindran <mravindr@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ravindran, Madhusudhanan (M.) 2015-03-16 15:36:41 +00:00 committed by Greg Kroah-Hartman
parent aa5735f139
commit 6a938a8cef
1 changed files with 3 additions and 0 deletions

View File

@ -282,6 +282,9 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
signed short *convert_buf = kmalloc(par->info->var.xres *
par->info->var.yres * sizeof(signed short), GFP_NOIO);
if (!convert_buf)
return -ENOMEM;
fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s()\n", __func__);
/* converting to grayscale16 */