diff options
| author | Fernando Soto <fsoto@bluecatnetworks.com> | 2013-06-14 19:13:35 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-17 02:17:48 -0400 |
| commit | 84672369ffb98a51d4ddf74c20a23636da3ad615 (patch) | |
| tree | 7056581822656336ecaea96d1edbfd51211dfde3 /drivers/hv | |
| parent | ad81f0545ef01ea651886dddac4bef6cec930092 (diff) | |
Drivers: hv: vmbus: incorrect device name is printed when child device is unregistered
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>
Diffstat (limited to 'drivers/hv')
| -rw-r--r-- | drivers/hv/vmbus_drv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index a2464bf07c49..e8e071fc1d6d 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c | |||
| @@ -690,7 +690,7 @@ int vmbus_device_register(struct hv_device *child_device_obj) | |||
| 690 | if (ret) | 690 | if (ret) |
| 691 | pr_err("Unable to register child device\n"); | 691 | pr_err("Unable to register child device\n"); |
| 692 | else | 692 | else |
| 693 | pr_info("child device %s registered\n", | 693 | pr_debug("child device %s registered\n", |
| 694 | dev_name(&child_device_obj->device)); | 694 | dev_name(&child_device_obj->device)); |
| 695 | 695 | ||
| 696 | return ret; | 696 | return ret; |
| @@ -702,14 +702,14 @@ int vmbus_device_register(struct hv_device *child_device_obj) | |||
| 702 | */ | 702 | */ |
| 703 | void vmbus_device_unregister(struct hv_device *device_obj) | 703 | void vmbus_device_unregister(struct hv_device *device_obj) |
| 704 | { | 704 | { |
| 705 | pr_debug("child device %s unregistered\n", | ||
| 706 | dev_name(&device_obj->device)); | ||
| 707 | |||
| 705 | /* | 708 | /* |
| 706 | * Kick off the process of unregistering the device. | 709 | * Kick off the process of unregistering the device. |
| 707 | * This will call vmbus_remove() and eventually vmbus_device_release() | 710 | * This will call vmbus_remove() and eventually vmbus_device_release() |
| 708 | */ | 711 | */ |
| 709 | device_unregister(&device_obj->device); | 712 | device_unregister(&device_obj->device); |
| 710 | |||
| 711 | pr_info("child device %s unregistered\n", | ||
| 712 | dev_name(&device_obj->device)); | ||
| 713 | } | 713 | } |
| 714 | 714 | ||
| 715 | 715 | ||
