mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 03:10:12 +00:00
staging: tidspbridge: fix memory corruption on long string names
The value allocated doesn't match the one that is meant to be stored, resulting in corruption of memory for longer strings that can't be held in such space. Fix by allocating the correct byte value for the string meant to be stored. Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7c256647b5
commit
94c947cd4e
1 changed files with 1 additions and 2 deletions
|
@ -852,8 +852,7 @@ int dcd_register_object(struct dsp_uuid *uuid_obj,
|
|||
goto func_end;
|
||||
}
|
||||
|
||||
dcd_key->path = kmalloc(strlen(sz_reg_key) + 1,
|
||||
GFP_KERNEL);
|
||||
dcd_key->path = kmalloc(dw_path_size, GFP_KERNEL);
|
||||
|
||||
if (!dcd_key->path) {
|
||||
kfree(dcd_key);
|
||||
|
|
Loading…
Reference in a new issue