summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormbalmer <mbalmer@openbsd.org>2006-12-15 16:49:39 +0000
committermbalmer <mbalmer@openbsd.org>2006-12-15 16:49:39 +0000
commitefe43b406f22039f781b24e58683399c74db2d42 (patch)
tree3c8dbb7341bb0ff4211ada61f72901e3c3510755
parentadd the HP NC373i PCI Express Multifunction Gigabit embedded server (diff)
downloadwireguard-openbsd-efe43b406f22039f781b24e58683399c74db2d42.tar.xz
wireguard-openbsd-efe43b406f22039f781b24e58683399c74db2d42.zip
Correct order of malloc(9) arguments.
Spotted by Constantine A. Murenin <cnst+openbsd@bugmail.mojo.ru>; thanks.
-rw-r--r--sys/kern/tty_nmea.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/tty_nmea.c b/sys/kern/tty_nmea.c
index 44099642b70..4ecac849707 100644
--- a/sys/kern/tty_nmea.c
+++ b/sys/kern/tty_nmea.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_nmea.c,v 1.13 2006/11/29 13:26:50 mbalmer Exp $ */
+/* $OpenBSD: tty_nmea.c,v 1.14 2006/12/15 16:49:39 mbalmer Exp $ */
/*
* Copyright (c) 2006 Marc Balmer <mbalmer@openbsd.org>
@@ -84,7 +84,7 @@ nmeaopen(dev_t dev, struct tty *tp)
return (ENODEV);
if ((error = suser(p, 0)) != 0)
return (error);
- np = malloc(sizeof(struct nmea), M_WAITOK, M_DEVBUF);
+ np = malloc(sizeof(struct nmea), M_DEVBUF, M_WAITOK);
bzero(np, sizeof(*np));
snprintf(np->time.device, sizeof(np->time.device), "nmea%d",
nmea_count++);