From: Ravindran, Madhusudhanan (M.) Date: Mon, 16 Mar 2015 15:36:41 +0000 (+0000) Subject: staging: fbtft: Fix potential null dereference X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6a938a8cef9abad2ae13e6a48329f5119930b0d6;p=openwrt%2Fstaging%2Fblogic.git staging: fbtft: Fix potential null dereference This error is found by smatch tool. Signed-off-by: Madhusudhanan Ravindran Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c index 578fdbe352d1..939b7b963043 100644 --- a/drivers/staging/fbtft/fb_agm1264k-fl.c +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c @@ -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 */