Fix null pointer error after vmbus loading. Remove code that checks for
dev_name, the affected structure is kzalloc-ed prior to this routine, so
it is always null at this stage.
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
DPRINT_DBG(VMBUS_DRV, "child device (%p) registering",
child_device_ctx);
DPRINT_DBG(VMBUS_DRV, "child device (%p) registering",
child_device_ctx);
- /* Make sure we are not registered already */
- if (strlen(dev_name(&child_device_ctx->device)) != 0) {
- DPRINT_ERR(VMBUS_DRV,
- "child device (%p) already registered - busid %s",
- child_device_ctx,
- dev_name(&child_device_ctx->device));
-
- ret = -1;
- goto Cleanup;
- }
-
- /* Set the device bus id. Otherwise, device_register()will fail. */
+ /* Set the device name. Otherwise, device_register() will fail. */
dev_set_name(&child_device_ctx->device, "vmbus_0_%d",
atomic_inc_return(&device_num));
dev_set_name(&child_device_ctx->device, "vmbus_0_%d",
atomic_inc_return(&device_num));
DPRINT_INFO(VMBUS_DRV, "child device (%p) registered",
&child_device_ctx->device);
DPRINT_INFO(VMBUS_DRV, "child device (%p) registered",
&child_device_ctx->device);
DPRINT_EXIT(VMBUS_DRV);
return ret;
DPRINT_EXIT(VMBUS_DRV);
return ret;