RE: [PATCH v2] Drivers: hv: vmbus: incorrect device name is printed when child device is unregistered
> -Original Message- > From: Fernando Soto [mailto:fs...@bluecatnetworks.com] > Sent: Friday, June 14, 2013 7:14 PM > To: linux-kernel@vger.kernel.org > Cc: Haiyang Zhang; KY Srinivasan; Greg KH (gre...@linuxfoundation.org) > Subject: [PATCH v2] Drivers: hv: vmbus: incorrect device name is printed when > child device is unregistered > > From: Fernando Soto > Please CC me, I am not subscribed to the list. > > 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 Signed-off-by: K. Y. Srinivasan > --- linux-3.10-rc5/drivers/hv/vmbus_drv.c.orig2013-06-13 > 19:20:55.359511352 - > 0400 > +++ linux-3.10-rc5/drivers/hv/vmbus_drv.c 2013-06-14 19:00:21.722105728 - > 0400 > @@ -686,7 +686,7 @@ int vmbus_device_register(struct hv_devi > if (ret) > pr_err("Unable to register child device\n"); > else > - pr_info("child device %s registered\n", > + pr_debug("child device %s registered\n", > dev_name(_device_obj->device)); > > return ret; > @@ -698,14 +698,14 @@ int vmbus_device_register(struct hv_devi > */ > void vmbus_device_unregister(struct hv_device *device_obj) > { > + pr_debug("child device %s unregistered\n", > + dev_name(_obj->device)); > + > /* >* Kick off the process of unregistering the device. >* This will call vmbus_remove() and eventually vmbus_device_release() >*/ > device_unregister(_obj->device); > - > - pr_info("child device %s unregistered\n", > - dev_name(_obj->device)); > } > > > -- > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH v2] Drivers: hv: vmbus: incorrect device name is printed when child device is unregistered
-Original Message- From: Fernando Soto [mailto:fs...@bluecatnetworks.com] Sent: Friday, June 14, 2013 7:14 PM To: linux-kernel@vger.kernel.org Cc: Haiyang Zhang; KY Srinivasan; Greg KH (gre...@linuxfoundation.org) Subject: [PATCH v2] Drivers: hv: vmbus: incorrect device name is printed when child device is unregistered From: Fernando Soto fs...@bluecatnetworks.com Please CC me, I am not subscribed to the list. 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 fs...@bluecatnetworks.com Signed-off-by: K. Y. Srinivasan k...@microsoft.com --- linux-3.10-rc5/drivers/hv/vmbus_drv.c.orig2013-06-13 19:20:55.359511352 - 0400 +++ linux-3.10-rc5/drivers/hv/vmbus_drv.c 2013-06-14 19:00:21.722105728 - 0400 @@ -686,7 +686,7 @@ int vmbus_device_register(struct hv_devi if (ret) pr_err(Unable to register child device\n); else - pr_info(child device %s registered\n, + pr_debug(child device %s registered\n, dev_name(child_device_obj-device)); return ret; @@ -698,14 +698,14 @@ int vmbus_device_register(struct hv_devi */ void vmbus_device_unregister(struct hv_device *device_obj) { + pr_debug(child device %s unregistered\n, + dev_name(device_obj-device)); + /* * Kick off the process of unregistering the device. * This will call vmbus_remove() and eventually vmbus_device_release() */ device_unregister(device_obj-device); - - pr_info(child device %s unregistered\n, - dev_name(device_obj-device)); } -- -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] Drivers: hv: vmbus: incorrect device name is printed when child device is unregistered
From: Fernando Soto Please CC me, I am not subscribed to the list. 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 --- linux-3.10-rc5/drivers/hv/vmbus_drv.c.orig 2013-06-13 19:20:55.359511352 -0400 +++ linux-3.10-rc5/drivers/hv/vmbus_drv.c 2013-06-14 19:00:21.722105728 -0400 @@ -686,7 +686,7 @@ int vmbus_device_register(struct hv_devi if (ret) pr_err("Unable to register child device\n"); else - pr_info("child device %s registered\n", + pr_debug("child device %s registered\n", dev_name(_device_obj->device)); return ret; @@ -698,14 +698,14 @@ int vmbus_device_register(struct hv_devi */ void vmbus_device_unregister(struct hv_device *device_obj) { + pr_debug("child device %s unregistered\n", + dev_name(_obj->device)); + /* * Kick off the process of unregistering the device. * This will call vmbus_remove() and eventually vmbus_device_release() */ device_unregister(_obj->device); - - pr_info("child device %s unregistered\n", - dev_name(_obj->device)); } -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] Drivers: hv: vmbus: incorrect device name is printed when child device is unregistered
From: Fernando Soto fs...@bluecatnetworks.com Please CC me, I am not subscribed to the list. 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 fs...@bluecatnetworks.com --- linux-3.10-rc5/drivers/hv/vmbus_drv.c.orig 2013-06-13 19:20:55.359511352 -0400 +++ linux-3.10-rc5/drivers/hv/vmbus_drv.c 2013-06-14 19:00:21.722105728 -0400 @@ -686,7 +686,7 @@ int vmbus_device_register(struct hv_devi if (ret) pr_err(Unable to register child device\n); else - pr_info(child device %s registered\n, + pr_debug(child device %s registered\n, dev_name(child_device_obj-device)); return ret; @@ -698,14 +698,14 @@ int vmbus_device_register(struct hv_devi */ void vmbus_device_unregister(struct hv_device *device_obj) { + pr_debug(child device %s unregistered\n, + dev_name(device_obj-device)); + /* * Kick off the process of unregistering the device. * This will call vmbus_remove() and eventually vmbus_device_release() */ device_unregister(device_obj-device); - - pr_info(child device %s unregistered\n, - dev_name(device_obj-device)); } -- -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/