From e101af8671a13a8eb8ce714e07294b73a99821cd Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Tue, 12 Nov 2019 12:46:20 +0100 Subject: [PATCH] drm-shim: fix EOF case Close input end of the pipe after data was written. Without this fix I have seen a hang in sysfs_uevent_get(.., "OF_FULLNAME") when key was not found. Signed-off-by: Christian Gmeiner Reviewed-by: Eric Anholt --- src/drm-shim/drm_shim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/drm-shim/drm_shim.c b/src/drm-shim/drm_shim.c index 7c7d5f0f009..381a94fb9d1 100644 --- a/src/drm-shim/drm_shim.c +++ b/src/drm-shim/drm_shim.c @@ -219,6 +219,7 @@ PUBLIC FILE *fopen(const char *path, const char *mode) pipe(fds); write(fds[1], file_overrides[i].contents, strlen(file_overrides[i].contents)); + close(fds[1]); return fdopen(fds[0], "r"); } } -- 2.30.2