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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +++ 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




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux