summaryrefslogtreecommitdiff
path: root/sys/dev/usb/udl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/udl.c')
-rw-r--r--sys/dev/usb/udl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c
index 35ee1fdab99..487416baece 100644
--- a/sys/dev/usb/udl.c
+++ b/sys/dev/usb/udl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udl.c,v 1.21 2009/08/02 10:38:34 miod Exp $ */
+/* $OpenBSD: udl.c,v 1.22 2009/08/09 20:10:08 mglocker Exp $ */
/*
* Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org>
@@ -872,7 +872,10 @@ udl_cmd_free_buf(struct udl_softc *sc)
{
struct udl_cmd_buf *cb = &sc->sc_cmd_buf;
- free(cb->buf, M_DEVBUF);
+ if (cb->buf != NULL) {
+ free(cb->buf, M_DEVBUF);
+ cb->buf = NULL;
+ }
cb->off = 0;
}