| From | Subject | Date |
|---|---|---|
| Dan Carpenter | [patch v2] Staging: xgfib: put parenthesis in the right place
In the original code the parenthesis are in the wrong position, so the
conditions are always true.
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
v2: white space changes.
Compile tested only.
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index 7016fdd..e19b932 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -3954,8 +3954,8 @@ void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
...
| Jan 3, 11:02 pm 2011 |
| Joe Perches | Re: [patch] Staging: xgfib: put parenthesis in the right place
Perhaps more legible and standard as:
if ((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) &&
(pVBInfo->LCDInfo & SetLCDDualLink))
--
| Jan 3, 10:20 pm 2011 |
| Dan Carpenter | [patch] Staging: xgfib: put parenthesis in the right place
In the original code the parenthesis are in the wrong position, so the
conditions are always true.
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
Compile tested only.
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index 7016fdd..0d69a88 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -3954,7 +3954,7 @@ void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned char ...
| Jan 3, 9:58 pm 2011 |
| Moger, Babu | RE: [patch] [SCSI] scsi_dh: potential null dereference i ...
You are right. This check may not be required.
But I am not sure why there is a check in scsi_device_from_queue.
Is there a possibility of request_fn other than scsi_request_fn for scsi device? I don’t know. Here is the code..
struct scsi_device *scsi_device_from_queue(struct request_queue *q)
{
struct scsi_device *sdev = NULL;
if (q->request_fn == scsi_request_fn)
sdev = q->queuedata;
return sdev;
}
| Jan 4, 12:50 pm 2011 |
| James Bottomley | RE: [patch] [SCSI] scsi_dh: potential null dereference i ...
It does? The first check is the bogus one, surely. The queue is
created and destroyed by scsi_alloc_sdev(), so queuedata can never be
NULL for a SCSI queue. There's no check anywhere in the rest of SCSI,
so there shouldn't be one here, should there?
James
--
| Jan 4, 9:24 am 2011 |
| Moger, Babu | Jan 4, 9:13 am 2011 | |
| James Bottomley | RE: [patch] [SCSI] scsi_dh: potential null dereference i ...
It can be called for any queue so it returns NULL for a non-SCSI queue.
If you think the queue scsi_dh_activate() is called on may be a non-scsi
one, then you need to use scsi_device_from_queue() and check the result.
Checking q->queuedata for NULL isn't sufficient because other devices
are perfectly entitled to use q->queuedata for their own purposes. If
you know you have a SCSI queue, you can just pick sdev out of
q->queuedata.
James
--
| Jan 4, 12:58 pm 2011 |
| previous day | today | next day |
|---|---|---|
| January 3, 2011 | January 4, 2011 | None |
