lkml.org 
[lkml]   [2001]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] DAC960.c - Null ptr fixes
On Thu, 24 May 2001, Praveen Srinivasan wrote:

> Hi,
> Using the Stanford checker, we searched for null-pointer bugs in the linux
> kernel code. This patch fixes numerous unchecked pointers in the DAC960
> driver (DAC960.c).
>
> Praveen Srinivasan and Frederick Akalin
>
>
> --- ../linux/./drivers/block/DAC960.c Tue Feb 20 21:26:22 2001
> +++ ./drivers/block/DAC960.c Mon May 7 21:56:30 2001
> @@ -508,6 +508,9 @@
> DAC960_Command_T *Command = DAC960_AllocateCommand(Controller);
> DAC960_V1_CommandMailbox_T *CommandMailbox = &Command->V1.CommandMailbox;
> DAC960_V1_CommandStatus_T CommandStatus;
> + if(Command == NULL) {
> + return 0;
> + }
> DAC960_V1_ClearCommand(Command);
> Command->CommandType = DAC960_ImmediateCommand;
> CommandMailbox->Type3.CommandOpcode = CommandOpcode;

[other similar examples snipped]

Shouldn't the check for NULL occur before '&Command->V1.CommandMailbox'?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:53    [W:0.029 / U:4.072 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site