]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: v4l: fwnode: Parse the graph endpoint as last
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 18 Jul 2018 13:20:34 +0000 (09:20 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 4 Oct 2018 20:14:42 +0000 (16:14 -0400)
Parsing the graph endpoint is always successful; therefore parse it as
last.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-fwnode.c

index caf4aa964cbd1c3e9648cd296dba0debabbaea73..5f3bb3d1191c3c0e6d69afac137f446d820b67d4 100644 (file)
@@ -303,7 +303,11 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
 
        pr_debug("===== begin V4L2 endpoint properties\n");
 
-       fwnode_graph_parse_endpoint(fwnode, &vep->base);
+       /*
+        * Zero the fwnode graph endpoint memory in case we don't end up parsing
+        * the endpoint.
+        */
+       memset(&vep->base, 0, sizeof(vep->base));
 
        /* Zero fields from bus_type to until the end */
        memset(&vep->bus_type, 0, sizeof(*vep) -
@@ -346,6 +350,8 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
                return -EINVAL;
        }
 
+       fwnode_graph_parse_endpoint(fwnode, &vep->base);
+
        return 0;
 }