Check kmem_cache_alloc return prior to init of sas_task struct. Signed-off-by: Mike Anderson <andmike@xxxxxxxxxx> include/scsi/sas/sas_task.h | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) Index: aic94xx-sas-2.6-patched/include/scsi/sas/sas_task.h =================================================================== --- aic94xx-sas-2.6-patched.orig/include/scsi/sas/sas_task.h 2006-03-28 09:19:29.000000000 -0800 +++ aic94xx-sas-2.6-patched/include/scsi/sas/sas_task.h 2006-03-30 08:46:06.000000000 -0800 @@ -212,12 +212,14 @@ static inline struct sas_task *sas_alloc extern kmem_cache_t *sas_task_cache; struct sas_task *task = kmem_cache_alloc(sas_task_cache, flags); - memset(task, 0, sizeof(*task)); - INIT_LIST_HEAD(&task->list); - spin_lock_init(&task->task_state_lock); - task->task_state_flags = SAS_TASK_STATE_PENDING; - init_timer(&task->timer); - init_completion(&task->completion); + if (task) { + memset(task, 0, sizeof(*task)); + INIT_LIST_HEAD(&task->list); + spin_lock_init(&task->task_state_lock); + task->task_state_flags = SAS_TASK_STATE_PENDING; + init_timer(&task->timer); + init_completion(&task->completion); + } return task; } - : send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html