linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] USB: core: Fix build warning in usb_get_configuration()
@ 2020-02-26  6:15 Tiezhu Yang
  2020-02-26  6:15 ` [PATCH 2/2] USB: core: Fix potential memory leak " Tiezhu Yang
  2020-02-26  8:04 ` [PATCH 1/2] USB: core: Fix build warning " Johan Hovold
  0 siblings, 2 replies; 8+ messages in thread
From: Tiezhu Yang @ 2020-02-26  6:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Xuefeng Li

There is no functional issue, just fix the following build warning:

  CC      drivers/usb/core/config.o
drivers/usb/core/config.c: In function ‘usb_get_configuration’:
drivers/usb/core/config.c:868:6: warning: ‘result’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  int result;
      ^

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/usb/core/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index b7918f6..bb63ee0 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -865,7 +865,7 @@ int usb_get_configuration(struct usb_device *dev)
 	unsigned int cfgno, length;
 	unsigned char *bigbuffer;
 	struct usb_config_descriptor *desc;
-	int result;
+	int result = 0;
 
 	if (ncfg > USB_MAXCONFIG) {
 		dev_warn(ddev, "too many configurations: %d, "
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-02-26 10:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26  6:15 [PATCH 1/2] USB: core: Fix build warning in usb_get_configuration() Tiezhu Yang
2020-02-26  6:15 ` [PATCH 2/2] USB: core: Fix potential memory leak " Tiezhu Yang
2020-02-26  8:09   ` Johan Hovold
2020-02-26  8:42     ` Tiezhu Yang
2020-02-26 10:12       ` Johan Hovold
2020-02-26  8:04 ` [PATCH 1/2] USB: core: Fix build warning " Johan Hovold
2020-02-26  8:35   ` Tiezhu Yang
2020-02-26 10:09     ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).