Re: [PATCH v2 -next] mtd: docg3: Fix a possible memory leak of mtd->name

2019-01-23 Thread YueHaibing
Pls ignore this err patch. On 2019/1/23 17:07, YueHaibing wrote: > In case DOC_CHIPID_G3, mtd->name is not freed in err handling path, > which is alloced by kasprintf(). Fix this by using devm_kasprintf(). > > Fixes: ae9d4934b2d7 ("mtd: docg3: add multiple floor support") > Signed-off-by:

[PATCH v2 -next] mtd: docg3: Fix a possible memory leak of mtd->name

2019-01-23 Thread YueHaibing
In case DOC_CHIPID_G3, mtd->name is not freed in err handling path, which is alloced by kasprintf(). Fix this by using devm_kasprintf(). Fixes: ae9d4934b2d7 ("mtd: docg3: add multiple floor support") Signed-off-by: YueHaibing --- v2: use devm_kasprintf --- drivers/mtd/devices/docg3.c | 4 ++--