Skip to content

Commit f990953

Browse files
mchehabehristev
authored andcommitted
media: atmel-isc: avoid returning a random value at isc_parse_dt()
As warned by smatch: drivers/media/platform/atmel/atmel-isc.c:2097 isc_parse_dt() error: uninitialized symbol 'ret'. The problem here is that of_graph_get_next_endpoint() can potentially return NULL on its first pass, with would make it return a random value, as ret is not initialized. While here, use while(1) instead of for(; ;), as while is the preferred syntax for such kind of loops. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
1 parent 6e39ce4 commit f990953

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/media/platform/atmel/atmel-isc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,10 +2033,10 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
20332033

20342034
INIT_LIST_HEAD(&isc->subdev_entities);
20352035

2036-
for (; ;) {
2036+
while (1) {
20372037
epn = of_graph_get_next_endpoint(np, epn);
20382038
if (!epn)
2039-
break;
2039+
return 0;
20402040

20412041
rem = of_graph_get_remote_port_parent(epn);
20422042
if (!rem) {

0 commit comments

Comments
 (0)