efi/efivars: Add missing kobject_put() in sysfs entry creation error path
authorArd Biesheuvel <ardb@kernel.org>
Fri, 22 May 2020 16:15:49 +0000 (18:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jun 2020 14:40:26 +0000 (16:40 +0200)
commite1437d181d303fe9635e17ccf0211e6999b091c9
tree83fb698d3400516bef02ec700cf65350c816c038
parentab2df991e5e280218099ff31cf96b51a6a38c86a
efi/efivars: Add missing kobject_put() in sysfs entry creation error path

commit d8bd8c6e2cfab8b78b537715255be8d7557791c0 upstream.

The documentation provided by kobject_init_and_add() clearly spells out
the need to call kobject_put() on the kobject if an error is returned.
Add this missing call to the error path.

Cc: <stable@vger.kernel.org>
Reported-by: 亿一 <teroincn@gmail.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/efi/efivars.c