sparc: vio: use put_device() instead of kfree()
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 25 Apr 2018 14:56:14 +0000 (20:26 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:31 +0000 (16:17 +0200)
commitea5ffcd46716fcda3da98313cffcf1ae5dcbb2c2
tree11e2262551db5d3fa6963aeb92f8e694d27e24cd
parentc98b38c5ede478b938944109e71798462c36c88c
sparc: vio: use put_device() instead of kfree()

[ Upstream commit 00ad691ab140b54ab9f5de5e74cb994f552e8124 ]

Never directly free @dev after calling device_register(), even
if it returned an error. Always use put_device() to give up the
reference initialized.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/sparc/kernel/vio.c