From 465001c775a516ac1c7c24302593b02c0f73f486 Mon Sep 17 00:00:00 2001 From: José Roberto de Souza Date: Tue, 23 Oct 2018 13:57:02 -0700 Subject: lib/psr: Add a macro with the maximum lenght of i915_edp_psr_status and use it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So every function reading i915_edp_psr_status can allocate a buffer long enough. Cc: Dhinakaran Pandiyan Reviewed-by: Dhinakaran Pandiyan Signed-off-by: José Roberto de Souza --- lib/igt_psr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/igt_psr.c') diff --git a/lib/igt_psr.c b/lib/igt_psr.c index 0ddfb64f..c105bb6e 100644 --- a/lib/igt_psr.c +++ b/lib/igt_psr.c @@ -28,7 +28,7 @@ static bool psr_active(int debugfs_fd, bool check_active) { bool active; - char buf[512]; + char buf[PSR_STATUS_MAX_LEN]; igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf, sizeof(buf)); -- cgit v1.2.3