Skip to content

Commit

Permalink
Staging: hv: file2alias: fix up alias creation logic for hv_vmbus_dev…
Browse files Browse the repository at this point in the history
…ice_id

When I added the driver_data field to hv_vmbus_device_id, I forgot to
take into the account how the alias was created, so it would append the
kernel pointer to the end of the alias, which is not correct.

This changes how the hv_vmbus_device_id alias is created to proper
account for the driver_data field.  As no module yet uses this alias, it
is safe to fix this up at this point in the commit stream.

Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Aug 25, 2011
1 parent 2e2c1d1 commit ebf16e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/mod/file2alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,9 @@ static int do_vmbus_entry(const char *filename, struct hv_vmbus_device_id *id,
char *alias)
{
int i;
char guid_name[((sizeof(struct hv_vmbus_device_id) + 1)) * 2];
char guid_name[((sizeof(id->guid) + 1)) * 2];

for (i = 0; i < (sizeof(struct hv_vmbus_device_id) * 2); i += 2)
for (i = 0; i < (sizeof(id->guid) * 2); i += 2)
sprintf(&guid_name[i], "%02x", id->guid[i/2]);

strcpy(alias, "vmbus:");
Expand Down

0 comments on commit ebf16e3

Please sign in to comment.