forked from Minki/linux
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>
This commit is contained in:
parent
cca80b9732
commit
bee527f979
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user