diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2009-10-23 14:14:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-10-30 17:47:43 -0400 |
commit | 1bb40a25b26ef7e2c4fb79ce430de2b9f836527f (patch) | |
tree | 4ab5f85e99400a2e1ca17f247d05db0a23d4819a /drivers | |
parent | 9bd0591be06a6a8e2f63c1dba4a64704c9d2002f (diff) |
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: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/hv/vmbus_drv.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c index 582318f10222..270fb7f64d75 100644 --- a/drivers/staging/hv/vmbus_drv.c +++ b/drivers/staging/hv/vmbus_drv.c | |||
@@ -537,18 +537,7 @@ static int vmbus_child_device_register(struct hv_device *root_device_obj, | |||
537 | DPRINT_DBG(VMBUS_DRV, "child device (%p) registering", | 537 | DPRINT_DBG(VMBUS_DRV, "child device (%p) registering", |
538 | child_device_ctx); | 538 | child_device_ctx); |
539 | 539 | ||
540 | /* Make sure we are not registered already */ | 540 | /* Set the device name. Otherwise, device_register() will fail. */ |
541 | if (strlen(dev_name(&child_device_ctx->device)) != 0) { | ||
542 | DPRINT_ERR(VMBUS_DRV, | ||
543 | "child device (%p) already registered - busid %s", | ||
544 | child_device_ctx, | ||
545 | dev_name(&child_device_ctx->device)); | ||
546 | |||
547 | ret = -1; | ||
548 | goto Cleanup; | ||
549 | } | ||
550 | |||
551 | /* Set the device bus id. Otherwise, device_register()will fail. */ | ||
552 | dev_set_name(&child_device_ctx->device, "vmbus_0_%d", | 541 | dev_set_name(&child_device_ctx->device, "vmbus_0_%d", |
553 | atomic_inc_return(&device_num)); | 542 | atomic_inc_return(&device_num)); |
554 | 543 | ||
@@ -573,7 +562,6 @@ static int vmbus_child_device_register(struct hv_device *root_device_obj, | |||
573 | DPRINT_INFO(VMBUS_DRV, "child device (%p) registered", | 562 | DPRINT_INFO(VMBUS_DRV, "child device (%p) registered", |
574 | &child_device_ctx->device); | 563 | &child_device_ctx->device); |
575 | 564 | ||
576 | Cleanup: | ||
577 | DPRINT_EXIT(VMBUS_DRV); | 565 | DPRINT_EXIT(VMBUS_DRV); |
578 | 566 | ||
579 | return ret; | 567 | return ret; |