The local variable ks0108_parport is used by other functions to write to
the parallel port. We missed initializing it when we converted the
driver to use new Parallel Port codes.

Fixes: 4edd70c133f3 ("auxdisplay: ks0108: use new parport device model")
Reported-by: Fengguang Wu <[email protected]>
Signed-off-by: Sudip Mukherjee <[email protected]>
---

Tested on kvm with the script provided by Fengguang Wu to reproduce the
error.

 drivers/auxdisplay/ks0108.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/auxdisplay/ks0108.c b/drivers/auxdisplay/ks0108.c
index 4c471bd..816de9e 100644
--- a/drivers/auxdisplay/ks0108.c
+++ b/drivers/auxdisplay/ks0108.c
@@ -146,6 +146,7 @@ static void ks0108_parport_attach(struct parport *port)
                goto err_unreg_device;
        }
 
+       ks0108_parport = port;
        ks0108_inited = 1;
        return;
 
@@ -167,6 +168,7 @@ static void ks0108_parport_detach(struct parport *port)
        parport_release(ks0108_pardevice);
        parport_unregister_device(ks0108_pardevice);
        ks0108_pardevice = NULL;
+       ks0108_parport = NULL;
 }
 
 /*
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to