Re: [PATCH 2/7] drm/meson: fix possible object reference leak

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

 



> @@ -720,13 +720,10 @@ static bool meson_hdmi_connector_is_available(struct device *dev)
>
>  	/* If the endpoint node exists, consider it enabled */
>  	remote = of_graph_get_remote_port(ep);
> -	if (remote) {
> -		of_node_put(ep);
> -		return true;
> -	}
> -
>  	of_node_put(ep);
>  	of_node_put(remote);

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/drm/meson/meson_dw_hdmi.c?id=61de49cb596710b918f7a80839f0b6de2017bc32#n712

Can the order of these put calls matter (because of processor caches)?


> +	if (remote)
> +		return true;
>
>  	return false;

Would the use of a ternary operator be more succinct here?

+	return remote ? true : false;

Regards,
Markus




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux