Re: [PATCH] DAC960.c - Null ptr fixes

Jim Treadway (jim@stardot-tech.com)
Thu, 24 May 2001 01:35:33 -0700 (PDT)


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/