From: Nirmoy Das <nirmoy.aiemd@gmail.com>
To: alexander.deucher@amd.com, christian.koenig@amd.com
Cc: airlied@linux.ie, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, nirmoy.das@amd.com
Subject: [PATCH] drm/amdgpu: fix memory leak
Date: Fri, 4 Oct 2019 12:17:46 +0200 [thread overview]
Message-ID: <20191004101746.19574-1-nirmoy.das@amd.com> (raw)
In amdgpu_bo_list_ioctl when idr_alloc fails
don't return without freeing bo list entry.
Fixes: 964d0fbf6301d ("drm/amdgpu: Allow to create BO lists in CS ioctl v3")
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
index 7bcf86c61999..c3e5ea544857 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
@@ -284,7 +284,7 @@ int amdgpu_bo_list_ioctl(struct drm_device *dev, void *data,
mutex_unlock(&fpriv->bo_list_lock);
if (r < 0) {
amdgpu_bo_list_put(list);
- return r;
+ goto error_free;
}
handle = r;
--
2.23.0
next reply other threads:[~2019-10-04 10:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-04 10:17 Nirmoy Das [this message]
2019-10-04 10:44 ` Koenig, Christian
2019-10-04 11:00 ` Nirmoy
2019-10-04 11:13 ` Koenig, Christian
2019-10-04 11:26 ` Nirmoy
2019-10-04 11:30 ` Koenig, Christian
2019-10-04 11:36 ` Nirmoy
-- strict thread matches above, loose matches on Subject: below --
2015-09-18 8:46 Sudip Mukherjee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191004101746.19574-1-nirmoy.das@amd.com \
--to=nirmoy.aiemd@gmail.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nirmoy.das@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®