From 86f05ea6cf407e42c8c0dec4d5753fcbe5780d87 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 26 Jan 2015 16:32:41 +0000 Subject: [PATCH] Lock the socket buffer before jumping to the 'out' label if sblock() fails in t4_soreceive_ddp(). --- sys/dev/cxgbe/tom/t4_ddp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index d09d3131ca4..6908de93ff1 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -1057,9 +1057,9 @@ t4_soreceive_ddp(struct socket *so, struct sockaddr **psa, struct uio *uio, /* Prevent other readers from entering the socket. */ error = sblock(sb, SBLOCKWAIT(flags)); + SOCKBUF_LOCK(sb); if (error) goto out; - SOCKBUF_LOCK(sb); /* Easy one, no space to copyout anything. */ if (uio->uio_resid == 0) {