lkml.org 
[lkml]   [2010]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 10/14] scsi: osd: fix device_register() error handling
    Date
    If device_register() fails then call put_device().
    See comment to device_register.

    Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
    ---
    compile tested.

    drivers/scsi/osd/osd_uld.c | 4 +++-
    1 files changed, 3 insertions(+), 1 deletions(-)

    diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c
    index cefb2c0..3e0edc2 100644
    --- a/drivers/scsi/osd/osd_uld.c
    +++ b/drivers/scsi/osd/osd_uld.c
    @@ -474,7 +474,7 @@ static int osd_probe(struct device *dev)
    error = device_register(&oud->class_dev);
    if (error) {
    OSD_ERR("device_register failed => %d\n", error);
    - goto err_put_cdev;
    + goto err_put_device;
    }

    get_device(&oud->class_dev);
    @@ -482,6 +482,8 @@ static int osd_probe(struct device *dev)
    OSD_INFO("osd_probe %s\n", disk->disk_name);
    return 0;

    +err_put_device:
    + put_device(&oud->class_dev);
    err_put_cdev:
    cdev_del(&oud->cdev);
    err_put_disk:
    --
    1.7.0.4


    \
     
     \ /
      Last update: 2010-09-19 14:59    [W:0.030 / U:61.420 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site