diff options
Diffstat (limited to 'drivers/scsi/osd')
-rw-r--r-- | drivers/scsi/osd/osd_uld.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c index 0bdef3390902..1ea6447f9418 100644 --- a/drivers/scsi/osd/osd_uld.c +++ b/drivers/scsi/osd/osd_uld.c | |||
@@ -224,7 +224,15 @@ void osduld_put_device(struct osd_dev *od) | |||
224 | 224 | ||
225 | BUG_ON(od->scsi_device != oud->od.scsi_device); | 225 | BUG_ON(od->scsi_device != oud->od.scsi_device); |
226 | 226 | ||
227 | /* If scsi has released the device (logout), and exofs has last | ||
228 | * reference on oud it will be freed by above osd_uld_release | ||
229 | * within fput below. But this will oops in cdev_release which | ||
230 | * is called after the fops->release. __uld_get/put pair makes | ||
231 | * sure we have a cdev for the duration of fput | ||
232 | */ | ||
233 | __uld_get(oud); | ||
227 | fput(od->file); | 234 | fput(od->file); |
235 | __uld_put(oud); | ||
228 | kfree(od); | 236 | kfree(od); |
229 | } | 237 | } |
230 | } | 238 | } |