Commit dd85c991 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Greg Kroah-Hartman

staging: tidspbridge: check kmalloc() result

If kmalloc() fails then exit with -ENOMEM.
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4018e396
......@@ -1407,6 +1407,8 @@ u32 strmwrap_allocate_buffer(union trapped_args *args, void *pr_ctxt)
return -EINVAL;
ap_buffer = kmalloc((num_bufs * sizeof(u8 *)), GFP_KERNEL);
if (ap_buffer == NULL)
return -ENOMEM;
status = strm_allocate_buffer(args->args_strm_allocatebuffer.hstream,
args->args_strm_allocatebuffer.usize,
......@@ -1446,6 +1448,8 @@ u32 strmwrap_free_buffer(union trapped_args *args, void *pr_ctxt)
return -EINVAL;
ap_buffer = kmalloc((num_bufs * sizeof(u8 *)), GFP_KERNEL);
if (ap_buffer == NULL)
return -ENOMEM;
CP_FM_USR(ap_buffer, args->args_strm_freebuffer.ap_buffer, status,
num_bufs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment