mm: memory_hotplug: use put_device() if device_register fail
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Thu, 26 Apr 2018 15:42:09 +0000 (21:12 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 May 2018 14:48:59 +0000 (16:48 +0200)
commit085aa2de568493d7cde52126512d37260077811a
tree22235cd9fcfa90729a66da2c7538cec0f0d56ba7
parent13509860efcada3e57c16d5f2e60dda8cef6054c
mm: memory_hotplug: use put_device() if device_register fail

if device_register() returned an error. Always use put_device()
to give up the initialized reference and release allocated memory.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/memory.c