lkml.org 
[lkml]   [2004]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [PATCH] Driver Core update for 2.6.4
    Date
    From
    ChangeSet 1.1608.84.4, 2004/03/10 16:05:28-08:00, chrisw@osdl.org

    [PATCH] class_simple cleanup in input

    Doesn't catch error on class_simple_add, and existing error return paths
    forget to class_simple_destroy.


    drivers/input/input.c | 4 ++++
    1 files changed, 4 insertions(+)


    diff -Nru a/drivers/input/input.c b/drivers/input/input.c
    --- a/drivers/input/input.c Mon Mar 15 15:29:55 2004
    +++ b/drivers/input/input.c Mon Mar 15 15:29:55 2004
    @@ -727,6 +727,8 @@
    int retval = -ENOMEM;

    input_class = class_simple_create(THIS_MODULE, "input");
    + if (IS_ERR(input_class))
    + return PTR_ERR(input_class);
    input_proc_init();
    retval = register_chrdev(INPUT_MAJOR, "input", &input_fops);
    if (retval) {
    @@ -734,6 +736,7 @@
    remove_proc_entry("devices", proc_bus_input_dir);
    remove_proc_entry("handlers", proc_bus_input_dir);
    remove_proc_entry("input", proc_bus);
    + class_simple_destroy(input_class);
    return retval;
    }

    @@ -743,6 +746,7 @@
    remove_proc_entry("handlers", proc_bus_input_dir);
    remove_proc_entry("input", proc_bus);
    unregister_chrdev(INPUT_MAJOR, "input");
    + class_simple_destroy(input_class);
    }
    return retval;
    }
    -
    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.032 / U:33.536 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site