mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
[media] coda: check kasprintf return value in coda_open
kasprintf might fail if free memory is low. Signed-off-by: Peter Seiderer <[email protected]> Signed-off-by: Philipp Zabel <[email protected]> Signed-off-by: Kamil Debski <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
parent
92b042eced
commit
a7f933a569
1 changed files with 6 additions and 0 deletions
|
|
@ -1628,6 +1628,11 @@ static int coda_open(struct file *file)
|
|||
set_bit(idx, &dev->instance_mask);
|
||||
|
||||
name = kasprintf(GFP_KERNEL, "context%d", idx);
|
||||
if (!name) {
|
||||
ret = -ENOMEM;
|
||||
goto err_coda_name_init;
|
||||
}
|
||||
|
||||
ctx->debugfs_entry = debugfs_create_dir(name, dev->debugfs_root);
|
||||
kfree(name);
|
||||
|
||||
|
|
@ -1742,6 +1747,7 @@ err_pm_get:
|
|||
v4l2_fh_del(&ctx->fh);
|
||||
v4l2_fh_exit(&ctx->fh);
|
||||
clear_bit(ctx->idx, &dev->instance_mask);
|
||||
err_coda_name_init:
|
||||
err_coda_max:
|
||||
kfree(ctx);
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue