Drivers: hv: vmbus: incorrect device name is printed when child device is unregistered
authorFernando Soto <fsoto@bluecatnetworks.com>
Fri, 14 Jun 2013 23:13:35 +0000 (23:13 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 6 Mar 2015 00:39:19 +0000 (00:39 +0000)
commit01c4de7a34c024d06309b5607c0374ae9855d0d3
tree7a2b7b6f923a9fef5c4d83d44f4f00a785109e19
parentc23f3a9fa7826af0465b9408b186f6b555991890
Drivers: hv: vmbus: incorrect device name is printed when child device is unregistered

commit 84672369ffb98a51d4ddf74c20a23636da3ad615 upstream.

Whenever a device is unregistered in vmbus_device_unregister (drivers/hv/vmbus_drv.c), the device name in the log message may contain garbage as the memory has already been freed by the time pr_info is called. Log example:
 [ 3149.170475] hv_vmbus: child device àõsèè0_5 unregistered

By logging the message just before calling device_unregister, the correct device name is printed:
[ 3145.034652] hv_vmbus: child device vmbus_0_5 unregistered

Also changing register & unregister messages to debug to avoid unnecessarily cluttering the kernel log.

Signed-off-by: Fernando M Soto <fsoto@bluecatnetworks.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/hv/vmbus_drv.c