Commit 141ecc53 authored by Cornelia Huck's avatar Cornelia Huck Committed by Greg Kroah-Hartman

driver core fixes: device_create_file() retval check in dmapool.c

Check for device_create_file() return value in dma_pool_create().
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a306eea4
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment