+ driver-core-fixes-device_create_file-retval-check-in.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

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

has been added to the -mm tree.  Its filename is

     driver-core-fixes-device_create_file-retval-check-in.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: driver core fixes: device_create_file() retval check in dmapool.c
From: Cornelia Huck <cornelia.huck@xxxxxxxxxx>

Check for device_create_file() return value in dma_pool_create().

Signed-off-by: Cornelia Huck <cornelia.huck@xxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/base/dmapool.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff -puN drivers/base/dmapool.c~driver-core-fixes-device_create_file-retval-check-in drivers/base/dmapool.c
--- a/drivers/base/dmapool.c~driver-core-fixes-device_create_file-retval-check-in
+++ a/drivers/base/dmapool.c
@@ -141,11 +141,20 @@ dma_pool_create (const char *name, struc
 	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);
_

Patches currently in -mm which might be from cornelia.huck@xxxxxxxxxx are

driver-core-fixes-make_class_name-retval-check.patch
driver-core-fixes-device_register-retval-check-in.patch
driver-core-fixes-sysfs_create_link-retval-check-in.patch
driver-core-fixes-bus_add_attrs-retval-check.patch
driver-core-fixes-bus_add_device-cleanup-on-error.patch
driver-core-fixes-device_add-cleanup-on-error.patch
driver-core-fixes-device_create_file-retval-check-in.patch
driver-core-fixes-sysfs_create_group-retval-in-topologyc.patch
git-s390.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux