Commit:     d91c088b39e3c66d309938de858775bb90fd1ead
Parent:     4bf3631cdb012591667ab927fcd7719d92837833
Author:     Andrea Righi <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 24 12:40:57 2007 -0400
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue Apr 24 12:40:57 2007 -0400

    [netdrvr] depca: handle platform_device_add() failure
    The following patch fixes a kernel 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
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
 drivers/net/depca.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index 5113eef..f3807aa 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -1491,8 +1491,9 @@ static void __init depca_platform_probe (void)
                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);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to