From: Anton Vorontsov Date: Fri, 14 May 2010 14:33:18 +0000 (+0400) Subject: USB: FHCI: cq_get() should check kfifo_out()'s return value X-Git-Tag: MMI-PSA29.97-13-9~23871^2~49 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7f1cccd3ec8789e52897bc34420ca81a5e2edeab;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git USB: FHCI: cq_get() should check kfifo_out()'s return value Since commit 7acd72eb85f1c7a15e8b5eb554994949241737f1 ("kfifo: rename kfifo_put... into kfifo_in... and kfifo_get... into kfifo_out..."), kfifo_out() is marked __must_check, and that causes gcc to produce lots of warnings like this: CC drivers/usb/host/fhci-mem.o In file included from drivers/usb/host/fhci-hcd.c:34: drivers/usb/host/fhci.h: In function 'cq_get': drivers/usb/host/fhci.h:520: warning: ignoring return value of 'kfifo_out', declared with attribute warn_unused_result ... This patch fixes the issue by properly checking the return value. Signed-off-by: Anton Vorontsov Cc: stable [.33 and .34] Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/fhci.h b/drivers/usb/host/fhci.h index 649ab07308f2..71c3caaea4c1 100644 --- a/drivers/usb/host/fhci.h +++ b/drivers/usb/host/fhci.h @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -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; }