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>
Sat, 20 Jun 2020 08:24:09 +0000 (10:24 +0200)
commit1e8fd13caaa1403c4b776acc2f9e2e21d4dfe00f
treeddb98af51c9ec6a8d73ddb40c498fa480c59e279
parentcc66d80027fc21111b2241a3bb0fc7ec21f99125
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