diff options
author | Pawel Osciak <p.osciak@samsung.com> | 2010-02-22 11:10:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:11:03 -0500 |
commit | bee527f97963ece5e3f6e6587402197af889865b (patch) | |
tree | 0acda315967bc394508836a2ea2e62dc24cfb16e | |
parent | cca80b973244cf7cf721b05b33178ba4826dbc5e (diff) |
V4L/DVB: videobuf: add missing checks for kzalloc returning NULL
Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/videobuf-dma-sg.c | 2 | ||||
-rw-r--r-- | drivers/media/video/videobuf-vmalloc.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index fa78555b118b..fcd045e7a1c1 100644 --- a/drivers/media/video/videobuf-dma-sg.c +++ b/drivers/media/video/videobuf-dma-sg.c | |||
@@ -418,6 +418,8 @@ static void *__videobuf_alloc(size_t size) | |||
418 | struct videobuf_buffer *vb; | 418 | struct videobuf_buffer *vb; |
419 | 419 | ||
420 | vb = kzalloc(size+sizeof(*mem),GFP_KERNEL); | 420 | vb = kzalloc(size+sizeof(*mem),GFP_KERNEL); |
421 | if (!vb) | ||
422 | return vb; | ||
421 | 423 | ||
422 | mem = vb->priv = ((char *)vb)+size; | 424 | mem = vb->priv = ((char *)vb)+size; |
423 | mem->magic=MAGIC_SG_MEM; | 425 | mem->magic=MAGIC_SG_MEM; |
diff --git a/drivers/media/video/videobuf-vmalloc.c b/drivers/media/video/videobuf-vmalloc.c index d6e6a28fb6b8..136e09383c06 100644 --- a/drivers/media/video/videobuf-vmalloc.c +++ b/drivers/media/video/videobuf-vmalloc.c | |||
@@ -138,6 +138,8 @@ static void *__videobuf_alloc(size_t size) | |||
138 | struct videobuf_buffer *vb; | 138 | struct videobuf_buffer *vb; |
139 | 139 | ||
140 | vb = kzalloc(size+sizeof(*mem),GFP_KERNEL); | 140 | vb = kzalloc(size+sizeof(*mem),GFP_KERNEL); |
141 | if (!vb) | ||
142 | return vb; | ||
141 | 143 | ||
142 | mem = vb->priv = ((char *)vb)+size; | 144 | mem = vb->priv = ((char *)vb)+size; |
143 | mem->magic=MAGIC_VMAL_MEM; | 145 | mem->magic=MAGIC_VMAL_MEM; |