Loading drivers/scsi/osd/osd_uld.c +7 −15 Original line number Diff line number Diff line Loading @@ -423,20 +423,12 @@ static int osd_probe(struct device *dev) if (scsi_device->type != TYPE_OSD) return -ENODEV; do { if (!ida_pre_get(&osd_minor_ida, GFP_KERNEL)) minor = ida_alloc_max(&osd_minor_ida, SCSI_OSD_MAX_MINOR, GFP_KERNEL); if (minor == -ENOSPC) return -EBUSY; if (minor < 0) return -ENODEV; error = ida_get_new(&osd_minor_ida, &minor); } while (error == -EAGAIN); if (error) return error; if (minor >= SCSI_OSD_MAX_MINOR) { error = -EBUSY; goto err_retract_minor; } error = -ENOMEM; oud = kzalloc(sizeof(*oud), GFP_KERNEL); if (NULL == oud) Loading Loading @@ -499,7 +491,7 @@ static int osd_probe(struct device *dev) err_free_osd: put_device(&oud->class_dev); err_retract_minor: ida_remove(&osd_minor_ida, minor); ida_free(&osd_minor_ida, minor); return error; } Loading @@ -514,7 +506,7 @@ static int osd_remove(struct device *dev) } cdev_device_del(&oud->cdev, &oud->class_dev); ida_remove(&osd_minor_ida, oud->minor); ida_free(&osd_minor_ida, oud->minor); put_device(&oud->class_dev); return 0; Loading Loading
drivers/scsi/osd/osd_uld.c +7 −15 Original line number Diff line number Diff line Loading @@ -423,20 +423,12 @@ static int osd_probe(struct device *dev) if (scsi_device->type != TYPE_OSD) return -ENODEV; do { if (!ida_pre_get(&osd_minor_ida, GFP_KERNEL)) minor = ida_alloc_max(&osd_minor_ida, SCSI_OSD_MAX_MINOR, GFP_KERNEL); if (minor == -ENOSPC) return -EBUSY; if (minor < 0) return -ENODEV; error = ida_get_new(&osd_minor_ida, &minor); } while (error == -EAGAIN); if (error) return error; if (minor >= SCSI_OSD_MAX_MINOR) { error = -EBUSY; goto err_retract_minor; } error = -ENOMEM; oud = kzalloc(sizeof(*oud), GFP_KERNEL); if (NULL == oud) Loading Loading @@ -499,7 +491,7 @@ static int osd_probe(struct device *dev) err_free_osd: put_device(&oud->class_dev); err_retract_minor: ida_remove(&osd_minor_ida, minor); ida_free(&osd_minor_ida, minor); return error; } Loading @@ -514,7 +506,7 @@ static int osd_remove(struct device *dev) } cdev_device_del(&oud->cdev, &oud->class_dev); ida_remove(&osd_minor_ida, oud->minor); ida_free(&osd_minor_ida, oud->minor); put_device(&oud->class_dev); return 0; Loading