Messages in this thread | | | Date | Tue, 12 Aug 2003 04:49:01 +0200 | From | Andries Brouwer <> | Subject | Re: [PATCH] oops in sd_shutdown |
| |
On Mon, Aug 11, 2003 at 06:13:50PM -0700, Jeff Woods wrote:
> Looking only at the above code snippet, I'd suggest something more like:
> + if (!sdp ||
This is not meaningful.
A general kind of convention is that a pointer will be NULL either by mistake, when it is uninitialized, or on purpose, when no object is present or no action (other than the default) needs to be performed.
But that general idea is broken by container_of(), which just subtracts a constant. So, one should check before subtracting that the pointer is non-NULL. Checking afterwards is meaningless.
- 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/
| |