Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288959
b: refs/heads/master
c: ffe1c05
h: refs/heads/master
i:
  288957: b574712
  288955: df33cf2
  288951: fbdd550
  288943: 7041469
  288927: f050483
  288895: a919aa2
v: v3
  • Loading branch information
Szymon Janc authored and Greg Kroah-Hartman committed Feb 9, 2012
1 parent 8c5dc12 commit a50eaad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f27a551968bb8780c8a5255c0ea6c3a2fcaf4a47
refs/heads/master: ffe1c0565c27324f6e23a5b47ae5ff873553c62f
21 changes: 12 additions & 9 deletions trunk/drivers/staging/quickstart/quickstart.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,21 +240,24 @@ static int quickstart_acpi_ghid(struct quickstart_acpi *quickstart)
return ret;
}

static int quickstart_acpi_config(struct quickstart_acpi *quickstart, char *bid)
static int quickstart_acpi_config(struct quickstart_acpi *quickstart)
{
int len = strlen(bid);
char *bid = acpi_device_bid(quickstart->device);
char *name;
int ret;

name = kmalloc(strlen(bid) + 1, GFP_KERNEL);
if (!name)
return -ENOMEM;

/* Add button to list */
ret = quickstart_btnlst_add(&quickstart->btn);
if (ret)
if (ret < 0) {
kfree(name);
return ret;

quickstart->btn->name = kzalloc(len + 1, GFP_KERNEL);
if (!quickstart->btn->name) {
quickstart_btnlst_free();
return -ENOMEM;
}

quickstart->btn->name = name;
strcpy(quickstart->btn->name, bid);

return 0;
Expand All @@ -280,7 +283,7 @@ static int quickstart_acpi_add(struct acpi_device *device)
device->driver_data = quickstart;

/* Add button to list and initialize some stuff */
ret = quickstart_acpi_config(quickstart, acpi_device_bid(device));
ret = quickstart_acpi_config(quickstart);
if (ret < 0)
goto fail_config;

Expand Down

0 comments on commit a50eaad

Please sign in to comment.