Skip to content

Commit

Permalink
V4L/DVB: videobuf: add missing checks for kzalloc returning NULL
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Pawel Osciak authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent cca80b9 commit bee527f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/video/videobuf-dma-sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ static void *__videobuf_alloc(size_t size)
struct videobuf_buffer *vb;

vb = kzalloc(size+sizeof(*mem),GFP_KERNEL);
if (!vb)
return vb;

mem = vb->priv = ((char *)vb)+size;
mem->magic=MAGIC_SG_MEM;
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/video/videobuf-vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ static void *__videobuf_alloc(size_t size)
struct videobuf_buffer *vb;

vb = kzalloc(size+sizeof(*mem),GFP_KERNEL);
if (!vb)
return vb;

mem = vb->priv = ((char *)vb)+size;
mem->magic=MAGIC_VMAL_MEM;
Expand Down

0 comments on commit bee527f

Please sign in to comment.