aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ntb/ntb_transport.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2016-07-09 12:00:04 +0000
committerAlexander Motin <mav@FreeBSD.org>2016-07-09 12:00:04 +0000
commitb42e3ec60b94176410d7a109bc266c5967db582e (patch)
treee8a20088edcc5e7df2de29836b8736e72acc206c /sys/dev/ntb/ntb_transport.c
parenta7e0f01a3d669fc708e6dca3b0134082e97105c5 (diff)
downloadsrc-b42e3ec60b94176410d7a109bc266c5967db582e.tar.gz
src-b42e3ec60b94176410d7a109bc266c5967db582e.zip
Improve memory allocation errors handling on receive.
Notes
Notes: svn path=/head/; revision=302495
Diffstat (limited to 'sys/dev/ntb/ntb_transport.c')
-rw-r--r--sys/dev/ntb/ntb_transport.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/ntb/ntb_transport.c b/sys/dev/ntb/ntb_transport.c
index 85647444e923..2e7ad2fee23f 100644
--- a/sys/dev/ntb/ntb_transport.c
+++ b/sys/dev/ntb/ntb_transport.c
@@ -877,6 +877,8 @@ ntb_memcpy_rx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry,
CTR2(KTR_NTB, "RX: copying %d bytes from offset %p", len, offset);
entry->buf = (void *)m_devget(offset, len, 0, ifp, NULL);
+ if (entry->buf == NULL)
+ entry->len = -ENOMEM;
/* Ensure that the data is globally visible before clearing the flag */
wmb();