Commit:     79baf4a60e8aceb2b8a5bed8575885499cb21ce4
Parent:     5050063c0464663a0b0c3dc9fc5bc822aa74a1dd
Author:     Christian Krafft <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 23 21:35:43 2007 +0200
Committer:  Arnd Bergmann <[EMAIL PROTECTED]>
CommitDate: Mon Apr 23 21:44:40 2007 +0200

    [POWERPC] add check for initialized driver data to pmi driver
    This patch adds a check for the private driver data to be initialized.
    The bug showed up, as the caller found a pmi device by it's type.
    Whereas the pmi driver probes for the type and the name.
    Since the name was not as the driver expected, it did not initialize.
    A more relaxed probing will be supplied with an extra patch, too.
    Signed-off-by: Christian Krafft <[EMAIL PROTECTED]>
    Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>
 arch/powerpc/sysdev/pmi.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c
index a528201..0b53fed 100644
--- a/arch/powerpc/sysdev/pmi.c
+++ b/arch/powerpc/sysdev/pmi.c
@@ -279,6 +279,9 @@ void pmi_register_handler(struct of_device *device,
        struct pmi_data *data;
        data = device->dev.driver_data;
+       if (!data)
+               return;
        list_add_tail(&handler->node, &data->handler);
@@ -289,10 +292,12 @@ void pmi_unregister_handler(struct of_device *device,
                            struct pmi_handler *handler)
        struct pmi_data *data;
+       data = device->dev.driver_data;
-       pr_debug("pmi: unregistering handler %p\n", handler);
+       if (!data)
+               return;
-       data = device->dev.driver_data;
+       pr_debug("pmi: unregistering handler %p\n", handler);
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