+ depcac-fix-handling-of-platorm_device_add-failure.patch added to -mm tree

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

 



The patch titled
     depca.c: fix handling of platorm_device_add() failure
has been added to the -mm tree.  Its filename is
     depcac-fix-handling-of-platorm_device_add-failure.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

------------------------------------------------------
Subject: depca.c: fix handling of platorm_device_add() failure
From: Andrea Righi <a.righi@xxxxxxxxx>

Fix a bug in depca_platform_probe().

We don't use a dynamic pointer for pldev->dev.platform_data, so it seems
that the correct way to proceed if platform_device_add(pldev) fails is to
explicitly set the pldev->dev.platform_data pointer to NULL, before calling
the platform_device_put(pldev), or it will be kfree'ed by
platform_device_release().

Cc: Jeff Garzik <jeff@xxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/net/depca.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/net/depca.c~depcac-fix-handling-of-platorm_device_add-failure drivers/net/depca.c
--- a/drivers/net/depca.c~depcac-fix-handling-of-platorm_device_add-failure
+++ a/drivers/net/depca.c
@@ -1491,8 +1491,9 @@ static void __init depca_platform_probe 
 		depca_io_ports[i].device = pldev;
 
 		if (platform_device_add(pldev)) {
-			platform_device_put(pldev);
 			depca_io_ports[i].device = NULL;
+			pldev->dev.platform_data = NULL;
+			platform_device_put(pldev);
 			continue;
 		}
 
_

Patches currently in -mm which might be from a.righi@xxxxxxxxx are

depcac-fix-handling-of-platorm_device_add-failure.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