]> git.baikalelectronics.ru Git - kernel.git/commit
firmware_loader: Fix memory leak in firmware upload
authorRuss Weight <russell.h.weight@intel.com>
Wed, 31 Aug 2022 00:25:18 +0000 (17:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Sep 2022 15:47:27 +0000 (17:47 +0200)
commit5ac9dceafe48d36933b663e9e232db167248ad0e
treeac7efbdb2aa65d3e69044fb646951ed63829f974
parent11c54a99c8111c8d652b97334d73fd96791473ef
firmware_loader: Fix memory leak in firmware upload

In the case of firmware-upload, an instance of struct fw_upload is
allocated in firmware_upload_register(). This data needs to be freed
in fw_dev_release(). Create a new fw_upload_free() function in
sysfs_upload.c to handle the firmware-upload specific memory frees
and incorporate the missing kfree call for the fw_upload structure.

Fixes: e4173eafd9da ("firmware_loader: Add firmware-upload support")
Cc: stable <stable@kernel.org>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
Link: https://lore.kernel.org/r/20220831002518.465274-1-russell.h.weight@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/firmware_loader/sysfs.c
drivers/base/firmware_loader/sysfs.h
drivers/base/firmware_loader/sysfs_upload.c