]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: think-lmi: Fix possible mem-leaks on tlmi_analyze() error-exit
authorHans de Goede <hdegoede@redhat.com>
Sat, 17 Jul 2021 14:36:07 +0000 (16:36 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sat, 17 Jul 2021 14:39:56 +0000 (16:39 +0200)
commitdb03bf2f741b9d56ac22ec7a7ee5378de5cf4f11
tree740e74933763e2d25d96c346631916ad0e77c30e
parent6515393faf2d60b2dd78a02607e4d12f303422d2
platform/x86: think-lmi: Fix possible mem-leaks on tlmi_analyze() error-exit

Fix 2 possible memleaks on error-exits from tlmi_analyze():

1. If the kzalloc of pwd_power fails, then not only free the atributes,
   but also the allocated pwd_admin struct.

2. Freeing the attributes should also free the possible_values strings.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210717143607.3580-3-hdegoede@redhat.com
drivers/platform/x86/think-lmi.c