Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304613
b: refs/heads/master
c: 8bdeeb2
h: refs/heads/master
i:
  304611: 6cce1d3
v: v3
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed May 10, 2012
1 parent a58d6a0 commit dce530a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 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: ba4dc61fe8c545a5d6a68b63616776556b771f51
refs/heads/master: 8bdeeb26c57012ea19a3b8fe3aeaecff377ae07d
25 changes: 14 additions & 11 deletions trunk/drivers/staging/ipack/bridges/tpci200.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static struct ipack_device *tpci200_slot_register(const char *board_name,
unsigned int slot_position)
{
int found = 0;
struct ipack_device *dev = NULL;
struct ipack_device *dev;
struct tpci200_board *tpci200;

list_for_each_entry(tpci200, &tpci200_list, list) {
Expand All @@ -390,24 +390,24 @@ static struct ipack_device *tpci200_slot_register(const char *board_name,
if (slot_position >= TPCI200_NB_SLOT) {
pr_info("Slot [%s %d:%d] doesn't exist!\n",
TPCI200_SHORTNAME, tpci200_number, slot_position);
goto out;
return NULL;
}

if (mutex_lock_interruptible(&tpci200->mutex))
goto out;
return NULL;

if (tpci200->slots[slot_position].dev != NULL) {
pr_err("Slot [%s %d:%d] already installed !\n",
TPCI200_SHORTNAME, tpci200_number, slot_position);
goto out_unlock;
goto err_unlock;
}

dev = kzalloc(sizeof(struct ipack_device), GFP_KERNEL);
if (dev == NULL) {
pr_info("Slot [%s %d:%d] Unable to allocate memory for new slot !\n",
TPCI200_SHORTNAME,
tpci200_number, slot_position);
goto out_unlock;
goto err_unlock;
}

if (size > IPACK_BOARD_NAME_SIZE) {
Expand Down Expand Up @@ -440,15 +440,18 @@ static struct ipack_device *tpci200_slot_register(const char *board_name,
dev->ops = &tpci200_bus_ops;
tpci200->slots[slot_position].dev = dev;

if (ipack_device_register(dev) < 0) {
tpci200_slot_unregister(dev);
kfree(dev);
}
if (ipack_device_register(dev) < 0)
goto err_unregister;

out_unlock:
mutex_unlock(&tpci200->mutex);
out:
return dev;

err_unregister:
tpci200_slot_unregister(dev);
kfree(dev);
err_unlock:
mutex_unlock(&tpci200->mutex);
return NULL;
}

static ssize_t tpci200_store_board(struct device *pdev, const char *buf,
Expand Down

0 comments on commit dce530a

Please sign in to comment.