[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211117014834.36999-1-bernard@vivo.com>
Date: Tue, 16 Nov 2021 17:48:28 -0800
From: Bernard Zhao <bernard@...o.com>
To: David Airlie <airlied@...ux.ie>, Daniel Vetter <daniel@...ll.ch>,
Lee Jones <lee.jones@...aro.org>,
Bernard Zhao <bernard@...o.com>, Lyude Paul <lyude@...hat.com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drm/selftest: fix potential memleak in error branch
This patch try to fix the potential memleak in error branch.
Signed-off-by: Bernard Zhao <bernard@...o.com>
---
drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c b/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c
index 6b4759ed6bfd..dbac073ed385 100644
--- a/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c
+++ b/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c
@@ -131,8 +131,10 @@ sideband_msg_req_encode_decode(struct drm_dp_sideband_msg_req_body *in)
return false;
txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL);
- if (!txmsg)
- return false;
+ if (!txmsg) {
+ result = false;
+ goto out;
+ }
drm_dp_encode_sideband_req(in, txmsg);
ret = drm_dp_decode_sideband_req(txmsg, out);
--
2.33.1
Powered by blists - more mailing lists