From: Luis R. Rodriguez Date: Fri, 29 May 2015 00:46:42 +0000 (-0700) Subject: firmware: add missing kfree for work on async call X-Git-Tag: firefly_0821_release~176^2~1546^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=303cda0ea7c1c33701812ccb80d37083a4093c7c;p=firefly-linux-kernel-4.4.55.git firmware: add missing kfree for work on async call The recent fix to use kstrdup_const() failed to add a kfree upon failure of name allocation... Cc: Ming Lei Cc: Seth Forshee Cc: Kyle McMartin Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 8c3aa3c2e94e..9c4288362a8e 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -1307,8 +1307,10 @@ request_firmware_nowait( fw_work->module = module; fw_work->name = kstrdup_const(name, gfp); - if (!fw_work->name) + if (!fw_work->name) { + kfree(fw_work); return -ENOMEM; + } fw_work->device = device; fw_work->context = context; fw_work->cont = cont;