Skip to content

Commit

Permalink
Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add()
Browse files Browse the repository at this point in the history
Use standard Linux error values and cleanup error handling. I would like
to acknowledge Andre Bartke (andre.bartke@gmail.com) for highlighting this
problem.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Aug 25, 2011
1 parent 5289d3d commit d225d36
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/staging/hv/storvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,8 @@ int storvsc_dev_add(struct hv_device *device,

device_info = (struct storvsc_device_info *)additional_info;
stor_device = alloc_stor_device(device);
if (!stor_device) {
ret = -1;
goto cleanup;
}
if (!stor_device)
return -ENOMEM;

/* Save the channel properties to our storvsc channel */

Expand All @@ -409,11 +407,13 @@ int storvsc_dev_add(struct hv_device *device,
stor_device->port_number = device_info->port_number;
/* Send it back up */
ret = storvsc_connect_to_vsp(device, device_info->ring_buffer_size);

if (ret) {
free_stor_device(stor_device);
return ret;
}
device_info->path_id = stor_device->path_id;
device_info->target_id = stor_device->target_id;

cleanup:
return ret;
}

Expand Down

0 comments on commit d225d36

Please sign in to comment.