lkml.org 
[lkml]   [2004]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 38/44] Fix oops (NULL pointer dereference) on resume in psmouse.c
    Date
    From
    You can pull this changeset from:
    bk://kernel.bkbits.net/vojtech/input

    ===================================================================

    ChangeSet@1.1608.78.12, 2004-03-08 14:32:00+01:00, vojtech@suse.cz
    input: Fix oops (NULL pointer dereference) on resume in psmouse.c,
    when the mouse goes away while sleeping.


    psmouse-base.c | 6 ++++--
    1 files changed, 4 insertions(+), 2 deletions(-)

    ===================================================================

    diff -Nru a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
    --- a/drivers/input/mouse/psmouse-base.c Tue Mar 16 13:17:45 2004
    +++ b/drivers/input/mouse/psmouse-base.c Tue Mar 16 13:17:45 2004
    @@ -643,12 +643,14 @@
    {
    struct psmouse *psmouse = serio->private;
    struct serio_dev *dev = serio->dev;
    - int old_type = psmouse->type;
    + int old_type;

    - if (!dev) {
    + if (!dev || !psmouse) {
    printk(KERN_DEBUG "psmouse: reconnect request, but serio is disconnected, ignoring...\n");
    return -1;
    }
    +
    + old_type = psmouse->type;

    psmouse->state = PSMOUSE_NEW_DEVICE;
    psmouse->type = psmouse->acking = psmouse->cmdcnt = psmouse->pktcnt = 0;
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:01    [W:0.022 / U:1.788 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site