Module Name:    src
Committed By:   ozaki-r
Date:           Sun May 21 08:36:22 UTC 2017

Modified Files:
        src/sys/netinet: wqinput.c

Log Message:
Add missing NULL check for pool_get call with PR_NOWAIT

This should fix a kernel panic reported by wiz@ on current-users ML:
  http://mail-index.netbsd.org/current-users/2017/05/03/msg031646.html


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/wqinput.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/wqinput.c
diff -u src/sys/netinet/wqinput.c:1.1 src/sys/netinet/wqinput.c:1.2
--- src/sys/netinet/wqinput.c:1.1	Thu Feb  2 02:52:10 2017
+++ src/sys/netinet/wqinput.c	Sun May 21 08:36:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wqinput.c,v 1.1 2017/02/02 02:52:10 ozaki-r Exp $	*/
+/*	$NetBSD: wqinput.c,v 1.2 2017/05/21 08:36:22 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -249,6 +249,11 @@ wqinput_input(struct wqinput *wqi, struc
 	}
 
 	work = pool_get(&wqi->wqi_work_pool, PR_NOWAIT);
+	if (work == NULL) {
+		wwl->wwl_dropped++;
+		m_freem(m);
+		goto out;
+	}
 	work->ww_mbuf = m;
 	work->ww_off = off;
 	work->ww_proto = proto;

Reply via email to