lkml.org 
[lkml]   [2015]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 1/3] staging: unisys: unregister chardev on error
    Date
    after registering the major numbers if the cdev_add fails then we were
    not releasing the major numbers. now we are doing that.

    Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
    ---

    v2: removed extra space

    drivers/staging/unisys/visorchipset/file.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c
    index 39b19af..074c285 100644
    --- a/drivers/staging/unisys/visorchipset/file.c
    +++ b/drivers/staging/unisys/visorchipset/file.c
    @@ -65,8 +65,10 @@ visorchipset_file_init(dev_t major_dev, struct visorchannel **controlvm_channel)
    return -1;
    }
    rc = cdev_add(&file_cdev, MKDEV(MAJOR(major_dev), 0), 1);
    - if (rc < 0)
    + if (rc < 0) {
    + unregister_chrdev_region(major_dev, 1);
    return -1;
    + }
    return 0;
    }

    --
    1.8.1.2


    \
     
     \ /
      Last update: 2015-03-27 11:01    [W:3.888 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site