diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2014-07-25 15:19:54 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-28 01:24:16 +0400 |
commit | 0a12830893e8b111189e9019848ead054b0f85b3 (patch) | |
tree | 609394e596e58ec4aa402a795acd7a0987a087a7 /drivers/media/pci/solo6x10/solo6x10-disp.c | |
parent | 9c9cb1fad865b3d9e9c4d7bbfbd20ca04cdc79b3 (diff) | |
download | linux-0a12830893e8b111189e9019848ead054b0f85b3.tar.xz |
[media] solo6x10: fix potential null dereference
drivers/media/pci/solo6x10/solo6x10-disp.c:221 solo_set_motion_block() error: potential null dereference
'buf'. (kzalloc returns null)
Also propagate this error up the chain.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/pci/solo6x10/solo6x10-disp.c')
-rw-r--r-- | drivers/media/pci/solo6x10/solo6x10-disp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/pci/solo6x10/solo6x10-disp.c b/drivers/media/pci/solo6x10/solo6x10-disp.c index ed88ab4455a5..5ea9cac03968 100644 --- a/drivers/media/pci/solo6x10/solo6x10-disp.c +++ b/drivers/media/pci/solo6x10/solo6x10-disp.c @@ -216,6 +216,8 @@ int solo_set_motion_block(struct solo_dev *solo_dev, u8 ch, int ret = 0; buf = kzalloc(size, GFP_KERNEL); + if (buf == NULL) + return -ENOMEM; for (y = 0; y < SOLO_MOTION_SZ; y++) { for (x = 0; x < SOLO_MOTION_SZ; x++) buf[x] = cpu_to_le16(thresholds[y * SOLO_MOTION_SZ + x]); |