From: Omar Ramirez Luna Date: Thu, 10 Jan 2013 09:36:59 +0000 (-0600) Subject: staging: tidspbridge: fix memory corruption on long string names X-Git-Tag: v3.9-rc1~127^2~448 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94c947cd4ec7c886df246f87255dc925e3a0a47f;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c index 9d52c3c..3d2a26f 100644 --- a/drivers/staging/tidspbridge/rmgr/dbdcd.c +++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c @@ -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);