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>
This commit is contained in:
parent
910b0797fa
commit
79c5453d3e
1 changed files with 2 additions and 2 deletions
|
@ -2039,10 +2039,10 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
|
||||||
|
|
||||||
INIT_LIST_HEAD(&isc->subdev_entities);
|
INIT_LIST_HEAD(&isc->subdev_entities);
|
||||||
|
|
||||||
for (; ;) {
|
while (1) {
|
||||||
epn = of_graph_get_next_endpoint(np, epn);
|
epn = of_graph_get_next_endpoint(np, epn);
|
||||||
if (!epn)
|
if (!epn)
|
||||||
break;
|
return 0;
|
||||||
|
|
||||||
rem = of_graph_get_remote_port_parent(epn);
|
rem = of_graph_get_remote_port_parent(epn);
|
||||||
if (!rem) {
|
if (!rem) {
|
||||||
|
|
Loading…
Reference in a new issue