Module Name: src
Committed By: riastradh
Date: Sat Mar 12 17:23:33 UTC 2022
Modified Files:
src/sys/net: bpf.c
Log Message:
bpf(4): Nix KM_NOSLEEP and prune dead branch.
https://syzkaller.appspot.com/bug?id=0fa7029d5565d9670a24c364d44bd116c76d7e7f
To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/sys/net/bpf.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/net/bpf.c
diff -u src/sys/net/bpf.c:1.244 src/sys/net/bpf.c:1.245
--- src/sys/net/bpf.c:1.244 Sat Mar 12 16:19:08 2022
+++ src/sys/net/bpf.c Sat Mar 12 17:23:32 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.c,v 1.244 2022/03/12 16:19:08 riastradh Exp $ */
+/* $NetBSD: bpf.c,v 1.245 2022/03/12 17:23:32 riastradh Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.244 2022/03/12 16:19:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.245 2022/03/12 17:23:32 riastradh Exp $");
#if defined(_KERNEL_OPT)
#include "opt_bpf.h"
@@ -2136,9 +2136,8 @@ static void
_bpfattach(struct ifnet *ifp, u_int dlt, u_int hdrlen, struct bpf_if **driverp)
{
struct bpf_if *bp;
- bp = kmem_alloc(sizeof(*bp), KM_NOSLEEP);
- if (bp == NULL)
- panic("%s: out of memory", __func__);
+
+ bp = kmem_alloc(sizeof(*bp), KM_SLEEP);
mutex_enter(&bpf_mtx);
bp->bif_driverp = driverp;