diff options
author | Dongliang Mu <dzm91@hust.edu.cn> | 2023-03-09 12:01:05 +0800 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2023-03-20 13:11:55 +0100 |
commit | 4d5a2a7d2c97dbd658533eea5f79dab1ad5dc0ee (patch) | |
tree | 7442e6af2dc4cdf950842cfd3a0c1bd42ad4363b /drivers/usb/cdns3/cdns3-ti.c | |
parent | da0ba0ccce54059d6c6b788a75099bfce95126da (diff) |
platform/x86/intel: tpmi: Fix double free in tpmi_create_device()
The previous commit 6a192c0cbf38 ("platform/x86/intel/tpmi: Fix
double free reported by Smatch") incorrectly handle the deallocation of
res variable. As shown in the comment, intel_vsec_add_aux handles all
the deallocation of res and feature_vsec_dev. Therefore, kfree(res) can
still cause double free if intel_vsec_add_aux returns error.
Fix this by adjusting the error handling part in tpmi_create_device,
following the function intel_vsec_add_dev.
Fixes: 6a192c0cbf38 ("platform/x86/intel/tpmi: Fix double free reported by Smatch")
Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
Link: https://lore.kernel.org/r/20230309040107.534716-2-dzm91@hust.edu.cn
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-ti.c')
0 files changed, 0 insertions, 0 deletions