Commit 1bb40a25 authored by Haiyang Zhang's avatar Haiyang Zhang Committed by Greg Kroah-Hartman

Staging: hv: Fix null pointer error after vmbus loading

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: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9bd0591b
...@@ -537,18 +537,7 @@ static int vmbus_child_device_register(struct hv_device *root_device_obj, ...@@ -537,18 +537,7 @@ static int vmbus_child_device_register(struct hv_device *root_device_obj,
DPRINT_DBG(VMBUS_DRV, "child device (%p) registering", DPRINT_DBG(VMBUS_DRV, "child device (%p) registering",
child_device_ctx); child_device_ctx);
/* Make sure we are not registered already */ /* Set the device name. Otherwise, device_register() will fail. */
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. */
dev_set_name(&child_device_ctx->device, "vmbus_0_%d", dev_set_name(&child_device_ctx->device, "vmbus_0_%d",
atomic_inc_return(&device_num)); atomic_inc_return(&device_num));
...@@ -573,7 +562,6 @@ static int vmbus_child_device_register(struct hv_device *root_device_obj, ...@@ -573,7 +562,6 @@ static int vmbus_child_device_register(struct hv_device *root_device_obj,
DPRINT_INFO(VMBUS_DRV, "child device (%p) registered", DPRINT_INFO(VMBUS_DRV, "child device (%p) registered",
&child_device_ctx->device); &child_device_ctx->device);
Cleanup:
DPRINT_EXIT(VMBUS_DRV); DPRINT_EXIT(VMBUS_DRV);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment