Re: [PATCH] drm/omap: dss: Fix refcount leak bugs

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

 



On 22/07/2022 17:43, Liang He wrote:
In dss_init_ports() and __dss_uninit_ports(), we should call
of_node_put() for the reference returned by of_graph_get_port_by_id()
in fail path or when it is not used anymore.

Fixes: 09bffa6e5192 ("drm: omap: use common OF graph helpers")
Signed-off-by: Liang He <windhl@xxxxxxx>
---
  drivers/gpu/drm/omapdrm/dss/dss.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 0399f3390a0a..c4febb861910 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1176,6 +1176,7 @@ static void __dss_uninit_ports(struct dss_device *dss, unsigned int num_ports)
  		default:
  			break;
  		}
+		of_node_put(port);
  	}
  }
@@ -1208,11 +1209,13 @@ static int dss_init_ports(struct dss_device *dss)
  		default:
  			break;
  		}
+		of_node_put(port);
  	}
return 0; error:
+	of_node_put(port);
  	__dss_uninit_ports(dss, i);
  	return r;
  }

Thanks, applying to drm-misc.

 Tomi



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux