Commit:     cdb32706f6948238ed6d1d85473c64c27366e9e9
Parent:     f6ce5cca74b8681fdf1d7307edc66a7213b43f6f
Author:     Mikulas Patocka <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 22 21:26:01 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Nov 26 19:39:01 2007 -0800

    plip: fix parport_register_device name parameter
    Plip passes a string "name" that is allocated on stack to
    parport_register_device.  parport_register_device holds the pointer to
    "name" and when the registering function exits, it points nowhere.
    On some machine, this bug causes bad names to appear in /proc, such as
    /proc/sys/dev/parport/parport0/devices/T^/�X^/�, on others, the plip
    proc node is completely missing.
    The patch also fixes documentation to note this requirement.
    Signed-off-by: Mikulas Patocka <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 Documentation/parport-lowlevel.txt |    4 ++++
 drivers/net/plip.c                 |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Documentation/parport-lowlevel.txt 
index 265fcdc..120eb20 100644
--- a/Documentation/parport-lowlevel.txt
+++ b/Documentation/parport-lowlevel.txt
@@ -339,6 +339,10 @@ Use this function to register your device driver on a 
parallel port
 ('port').  Once you have done that, you will be able to use
 parport_claim and parport_release in order to use the port.
+The ('name') argument is the name of the device that appears in /proc
+filesystem. The string must be valid for the whole lifetime of the
+device (until parport_unregister_device is called).
 This function will register three callbacks into your driver:
 'preempt', 'wakeup' and 'irq'.  Each of these may be NULL in order to
 indicate that you do not want a callback.
diff --git a/drivers/net/plip.c b/drivers/net/plip.c
index baf2cbf..57c9866 100644
--- a/drivers/net/plip.c
+++ b/drivers/net/plip.c
@@ -1269,7 +1269,7 @@ static void plip_attach (struct parport *port)
                nl = netdev_priv(dev);
                nl->dev = dev;
-               nl->pardev = parport_register_device(port, name, plip_preempt,
+               nl->pardev = parport_register_device(port, dev->name, 
                                                 plip_wakeup, plip_interrupt,
                                                 0, dev);
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