diff options
author | Ravindran, Madhusudhanan (M.) <mravindr@visteon.com> | 2015-03-16 15:36:41 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-20 13:54:50 +0100 |
commit | 6a938a8cef9abad2ae13e6a48329f5119930b0d6 (patch) | |
tree | 31e921dec65c20067d20ef6a1d511ff62882ba00 /drivers/staging/fbtft | |
parent | aa5735f139f84a3d1e4ef4d0ba177a25372506fb (diff) |
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>
Diffstat (limited to 'drivers/staging/fbtft')
-rw-r--r-- | drivers/staging/fbtft/fb_agm1264k-fl.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 */ |