From 285610b28380e65a28925c418526ec22173aaa12 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 17 Jul 2024 16:14:33 +0200 Subject: [PATCH] Xext: vidmode: ProcVidModeSetGammaRamp() simplify payload write out WriteToClient() already checks for zero-length buffer and does nothing in that case. So we can make the code a bit easier to read and also allow further simplification of reply submission by upcoming commits. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/vidmode.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Xext/vidmode.c b/Xext/vidmode.c index cc259e938..aca854008 100644 --- a/Xext/vidmode.c +++ b/Xext/vidmode.c @@ -1585,11 +1585,8 @@ ProcVidModeGetGammaRamp(ClientPtr client) SwapShorts((short *) ramp, length * 3); } WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), &rep); - - if (stuff->size) { - WriteToClient(client, ramplen, ramp); - free(ramp); - } + WriteToClient(client, ramplen, ramp); + free(ramp); return Success; }