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:41:55 +0000 (16:41 +0200)
commitace87a941529de7cdf3732b6ada7a2c02d972cf6
treeb5609f7fc903f4502be85fbaa9d3d616c4ccd0a6
parentc106c81a0f6c5c18b344806041fed21470a5c5e5
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