@@ -209,6 +209,7 @@ static const char *lun_state[] =
struct rdac_queue_data {
struct list_head entry;
struct rdac_dh_data *h;
+ struct scsi_device *sdev;
activate_complete callback_fn;
void *callback_data;
};
@@ -614,6 +615,9 @@ done:
qdata->h->state = RDAC_STATE_ACTIVE;
if (qdata->callback_fn)
qdata->callback_fn(qdata->callback_data, err);
+ kref_put(&qdata->sdev->scsi_dh_data->kref,
+ scsi_dh_handler_cleanup);
+ put_device(&qdata->sdev->sdev_gendev);
kfree(qdata);
}
return;
@@ -630,6 +634,7 @@ static int queue_mode_select(struct scsi
return SCSI_DH_RETRY;
qdata->h = get_rdac_data(sdev);
+ qdata->sdev = sdev;
qdata->callback_fn = fn;
qdata->callback_data = data;
@@ -663,6 +668,8 @@ static int rdac_activate(struct scsi_dev
done:
if (fn)
fn(data, err);
+ kref_put(&sdev->scsi_dh_data->kref, scsi_dh_handler_cleanup);
+ put_device(&sdev->sdev_gendev);
return 0;
}