Skip to content

Commit

Permalink
driver core fixes: device_create_file() retval check in dmapool.c
Browse files Browse the repository at this point in the history
Check for device_create_file() return value in dma_pool_create().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Cornelia Huck authored and Greg Kroah-Hartman committed Oct 18, 2006
1 parent a306eea commit 141ecc5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/base/dmapool.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,20 @@ dma_pool_create (const char *name, struct device *dev,
init_waitqueue_head (&retval->waitq);

if (dev) {
int ret;

down (&pools_lock);
if (list_empty (&dev->dma_pools))
device_create_file (dev, &dev_attr_pools);
ret = device_create_file (dev, &dev_attr_pools);
else
ret = 0;
/* note: not currently insisting "name" be unique */
list_add (&retval->pools, &dev->dma_pools);
if (!ret)
list_add (&retval->pools, &dev->dma_pools);
else {
kfree(retval);
retval = NULL;
}
up (&pools_lock);
} else
INIT_LIST_HEAD (&retval->pools);
Expand Down

0 comments on commit 141ecc5

Please sign in to comment.