EDAC/sysfs: Drop device references properly
authorGreg KH <gregkh@linuxfoundation.org>
Wed, 8 May 2019 10:40:42 +0000 (12:40 +0200)
committerTony Luck <tony.luck@intel.com>
Thu, 20 Jun 2019 18:44:36 +0000 (11:44 -0700)
commit7adc05d2dc3af95e4e1534841d58f736262142cd
tree9d4c047fda186cd7d7dcbc665243f3348c2c7212
parent585fb3d93d32dbe89e718b85009f9c322cc554cd
EDAC/sysfs: Drop device references properly

Do put_device() if device_add() fails.

 [ bp: do device_del() for the successfully created devices in
   edac_create_csrow_objects(), on the unwind path. ]

Signed-off-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20190427214925.GE16338@kroah.com
drivers/edac/edac_mc_sysfs.c