Re: [PATCH 3/3] ethernet: ti: fix possible object reference leak
From: Markus Elfring
Date: Fri Apr 05 2019 - 04:28:25 EST
> @@ -3657,12 +3657,16 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
>
> ret = netcp_txpipe_init(&gbe_dev->tx_pipe, netcp_device,
> gbe_dev->dma_chan_name, gbe_dev->tx_queue_id);
> - if (ret)
> + if (ret) {
> + of_node_put(interfaces);
> return ret;
> + }
>
> ret = netcp_txpipe_open(&gbe_dev->tx_pipe);
> - if (ret)
> + if (ret) {
> + of_node_put(interfaces);
> return ret;
> + }
>
> /* Create network interfaces */
> INIT_LIST_HEAD(&gbe_dev->gbe_intf_head);
Would you like to move such duplicate statements to an additional jump target
for the desired exception handling?
Regards,
Markus