lkml.org 
[lkml]   [2010]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] libsas: potential null dereference
The "sc" variable can potentially be null here, so we have to initialize
"q" later. This was introduced in: 70b25f890 "[SCSI] fix locking around
blk_abort_request()"

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
I appologize if I sent this already. I was having trouble with my email
earlier today and I don't see this in my gmail outbox.

diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index 8228350..96dc7d0 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -1030,7 +1030,7 @@ int __sas_task_abort(struct sas_task *task)
void sas_task_abort(struct sas_task *task)
{
struct scsi_cmnd *sc = task->uldd_task;
- struct request_queue *q = sc->device->request_queue;
+ struct request_queue *q;
unsigned long flags;

/* Escape for libsas internal commands */
@@ -1046,6 +1046,7 @@ void sas_task_abort(struct sas_task *task)
return;
}

+ q = sc->device->request_queue;
spin_lock_irqsave(q->queue_lock, flags);
blk_abort_request(sc->request);
spin_unlock_irqrestore(q->queue_lock, flags);


\
 
 \ /
  Last update: 2010-05-13 00:57    [W:0.019 / U:9.996 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site