From 75768c6dd65bb10f20e7b2346de829ce9791a307 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 6 Feb 2014 13:05:26 +0000 Subject: [PATCH] scst_local: Fix a kernel oops for kernel versions < 2.6.37 (merge r5264 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@5265 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst_local/scst_local.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 2319e7655..67d554563 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -949,6 +949,14 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt, TRACE_DBG("lun %d, cmd: 0x%02X", SCpnt->device->lun, SCpnt->cmnd[0]); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) + /* + * We save a pointer to the done routine in SCpnt->scsi_done and + * we save that as tgt specific stuff below. + */ + SCpnt->scsi_done = done; +#endif + sess = to_scst_lcl_sess(scsi_get_device(SCpnt->device->host)); if (sess->unregistering) { @@ -972,12 +980,6 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt, } tgt_specific->cmnd = SCpnt; tgt_specific->done = done; -#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) - /* - * We save a pointer to the done routine in SCpnt->scsi_done and - * we save that as tgt specific stuff below. - */ - SCpnt->scsi_done = done; #endif /*