* [PATCH] staging: most: usb: init return value in default path of switch/case expression
@ 2020-05-28 12:41 ` Christian Gromm
0 siblings, 0 replies; 2+ messages in thread
From: Christian Gromm @ 2020-05-28 12:41 UTC (permalink / raw)
To: gregkh; +Cc: driverdev-devel, linux-usb, Christian Gromm
This patch avoids returning an uninitialized value in the default
path of the switch expression.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/staging/most/usb/usb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c
index df5876c..2640c5b 100644
--- a/drivers/staging/most/usb/usb.c
+++ b/drivers/staging/most/usb/usb.c
@@ -215,6 +215,7 @@ static unsigned int get_stream_frame_size(struct device *dev,
break;
default:
dev_warn(dev, "Query frame size of non-streaming channel\n");
+ frame_size = 0;
break;
}
return frame_size;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] staging: most: usb: init return value in default path of switch/case expression
@ 2020-05-28 12:41 ` Christian Gromm
0 siblings, 0 replies; 2+ messages in thread
From: Christian Gromm @ 2020-05-28 12:41 UTC (permalink / raw)
To: gregkh; +Cc: Christian Gromm, driverdev-devel, linux-usb
This patch avoids returning an uninitialized value in the default
path of the switch expression.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/staging/most/usb/usb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c
index df5876c..2640c5b 100644
--- a/drivers/staging/most/usb/usb.c
+++ b/drivers/staging/most/usb/usb.c
@@ -215,6 +215,7 @@ static unsigned int get_stream_frame_size(struct device *dev,
break;
default:
dev_warn(dev, "Query frame size of non-streaming channel\n");
+ frame_size = 0;
break;
}
return frame_size;
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-28 12:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 12:41 [PATCH] staging: most: usb: init return value in default path of switch/case expression Christian Gromm
2020-05-28 12:41 ` Christian Gromm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.