diff options
author | Hans de Goede <hdegoede@redhat.com> | 2021-07-17 17:36:06 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2021-07-17 17:39:55 +0300 |
commit | 30e78435d3bf803cabdc2a1c2eb36e6983aa4596 (patch) | |
tree | 8133dae389a0134d542e7af07ec0b3204ac206a7 /ipc | |
parent | e62fb1e3faae60f483a96c359c8d72bb04a7b728 (diff) | |
download | linux-30e78435d3bf803cabdc2a1c2eb36e6983aa4596.tar.xz |
platform/x86: think-lmi: Split kobject_init() and kobject_add() calls
tlmi_sysfs_init() calls tlmi_release_attr() on errors which calls
kobject_put() for attributes created by tlmi_analyze(), but if we
bail early because of an error, then this means that some of the
kobjects will not have been initialized yet; and we should thus not
call kobject_put() on them.
Switch from using kobject_init_and_add() inside tlmi_sysfs_init() to
initializing all the created kobjects directly in tlmi_analyze() and
only adding them from tlmi_sysfs_init(). This way all kobjects will
always be initialized when tlmi_release_attr() gets called.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210717143607.3580-2-hdegoede@redhat.com
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions