diff options
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/fhci.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/host/fhci.h b/drivers/usb/host/fhci.h index 649ab07..71c3caa 100644 --- a/drivers/usb/host/fhci.h +++ b/drivers/usb/host/fhci.h @@ -20,6 +20,7 @@ #include <linux/kernel.h> #include <linux/types.h> +#include <linux/bug.h> #include <linux/spinlock.h> #include <linux/interrupt.h> #include <linux/kfifo.h> @@ -515,9 +516,13 @@ static inline int cq_put(struct kfifo *kfifo, void *p) static inline void *cq_get(struct kfifo *kfifo) { - void *p = NULL; + unsigned int sz; + void *p; + + sz = kfifo_out(kfifo, (void *)&p, sizeof(p)); + if (sz != sizeof(p)) + return NULL; - kfifo_out(kfifo, (void *)&p, sizeof(p)); return p; } |