Re: [PATCH 1/3] media: xilinx: fix leaked of_node references

From: Markus Elfring
Date: Fri Jun 28 2019 - 08:46:20 EST


> +++ b/drivers/media/platform/xilinx/xilinx-tpg.c
> @@ -713,10 +713,13 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
> struct device_node *port;
> unsigned int nports = 0;
> bool has_endpoint = false;
> + int ret = 0;
>
> ports = of_get_child_by_name(node, "ports");
> - if (ports == NULL)
> + if (ports == NULL) {

The script âcheckpatch.plâ can point information out like âComparison to NULL
could be written ââ.
Thus fix the affected source code place.

+ if (!ports) {


> ports = node;
> + of_node_get(ports);
> + }
>
> for_each_child_of_node(ports, port) {
> const struct xvip_video_format *format;


Regards,
Markus