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:
parent
aa5735f139
commit
6a938a8cef
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue