linux/drivers/acpi/nfit
Prarit Bhargava 7e700d2c59 acpi/nfit: Fix memory corruption/Unregister mce decoder on failure
nfit_init() calls nfit_mce_register() on module load.  When the module
load fails the nfit mce decoder is not unregistered.  The module's
memory is freed leaving the decoder chain referencing junk.  This will
cause panics as future registrations will reference the free'd memory.

Unregister the nfit mce decoder on module init failure.

[v2]: register and then unregister mce handler to avoid losing mce events
[v3]: also cleanup nfit workqueue

Fixes: 6839a6d96f ("nfit: do an ARS scrub on hitting a latent media error")
Cc: <stable@vger.kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>
Cc: Linda Knippers <linda.knippers@hpe.com>
Cc: lszubowi@redhat.com
Acked-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2017-07-17 11:43:58 -07:00
..
core.c acpi/nfit: Fix memory corruption/Unregister mce decoder on failure 2017-07-17 11:43:58 -07:00
Kconfig acpi, nfit: kill ACPI_NFIT_DEBUG 2017-04-28 16:07:00 -07:00
Makefile nfit: do an ARS scrub on hitting a latent media error 2016-07-24 08:04:04 -07:00
mce.c acpi/nfit: Issue Start ARS to retrieve existing records 2017-07-02 09:56:37 -07:00
nfit.h acpi/nfit: Issue Start ARS to retrieve existing records 2017-07-02 09:56:37 -07:00