diff options
author | Robin Holt <holt@sgi.com> | 2009-01-29 14:25:07 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-02 08:28:14 -0800 |
commit | a0d7c5fa0846e922f379189812ceae2f75fce356 (patch) | |
tree | d0891b8eb748361e994514be132d5e8dd7c09adf | |
parent | b706840821ea31290cdb235534578aed02e83330 (diff) | |
download | lwn-a0d7c5fa0846e922f379189812ceae2f75fce356.tar.gz lwn-a0d7c5fa0846e922f379189812ceae2f75fce356.zip |
sgi-xpc: Remove NULL pointer dereference.
commit 17e2161654da4e6bdfd8d53d4f52e820ee93f423 upstream.
If the bte copy fails, the attempt to retrieve payloads merely returns a
null pointer deref and not NULL as was expected.
Signed-off-by: Robin Holt <holt@sgi.com>
Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/misc/sgi-xp/xpc_sn2.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c index a27749549487..59ff816799fb 100644 --- a/drivers/misc/sgi-xp/xpc_sn2.c +++ b/drivers/misc/sgi-xp/xpc_sn2.c @@ -1962,11 +1962,13 @@ xpc_get_deliverable_payload_sn2(struct xpc_channel *ch) msg = xpc_pull_remote_msg_sn2(ch, get); - DBUG_ON(msg != NULL && msg->number != get); - DBUG_ON(msg != NULL && (msg->flags & XPC_M_SN2_DONE)); - DBUG_ON(msg != NULL && !(msg->flags & XPC_M_SN2_READY)); + if (msg != NULL) { + DBUG_ON(msg->number != get); + DBUG_ON(msg->flags & XPC_M_SN2_DONE); + DBUG_ON(!(msg->flags & XPC_M_SN2_READY)); - payload = &msg->payload; + payload = &msg->payload; + } break; } |