[ofw] RE: PATCH: [hw] Don't try to write to event log when there is no driver object.
Fab Tillier
ftillier at windows.microsoft.com
Mon Feb 9 10:12:53 PST 2009
>Index: Q:/projinf2/trunk/hw/mlx4/kernel/bus/core/l2w_debug.c
>===================================================================
>--- Q:/projinf2/trunk/hw/mlx4/kernel/bus/core/l2w_debug.c (revision
>3931)
>+++ Q:/projinf2/trunk/hw/mlx4/kernel/bus/core/l2w_debug.c (revision
>3932)
>@@ -45,6 +45,11 @@
> int l_PktSize
>=sizeof(IO_ERROR_LOG_PACKET)+pi_nDataItems*sizeof(ULONG);
> int l_TotalSize =l_PktSize +l_Size;
>
>+ if (pi_pIoObject == NULL) {
>+ ASSERT(FALSE);
Same comment as in my previous email - ASSERT( FALSE ) doesn't generate a useful assertion message. In this case, ASSERT( pi_pIoObject != NULL ) would do the trick.
Same for the following assertions.
>+ return;
>+ }
>+
> /* Init the variable argument list */
> va_start(l_Argptr, pi_nDataItems);
>
>@@ -132,6 +137,13 @@
> // print to Debugger
> va_start(list, format);
> buf[MAX_BUFFER_SIZE - 1] = '\0';
>+
>+ if (mdev == NULL) {
>+ ASSERT(FALSE);
>+ return;
>+ }
>+
>+
> if (RtlStringCbVPrintfA( (char*)buf, sizeof(buf), format, list))
> return;
> cl_dbg_out( "%s\n", (char*)buf );
>@@ -177,6 +189,11 @@
> UCHAR buf[MAX_BUFFER_SIZE];
> WCHAR wbuf[MAX_BUFFER_SIZE];
>
>+ if (mdev == NULL) {
>+ ASSERT(FALSE);
>+ return;
>+ }
>+
> // print to Debugger
> va_start(list, format);
> buf[MAX_BUFFER_SIZE - 1] = '\0';
More information about the ofw
mailing list