mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
drm/msm: fix msm_gem_prime_get_sg_table()
We need to return a new sgt, since the caller takes ownership of it. Reported-by: Stanimir Varbanov <svarbanov@mm-sol.com> Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
parent
8f9cb50789
commit
bbcc71872a
1 changed files with 6 additions and 2 deletions
|
@ -23,8 +23,12 @@
|
|||
struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj)
|
||||
{
|
||||
struct msm_gem_object *msm_obj = to_msm_bo(obj);
|
||||
BUG_ON(!msm_obj->sgt); /* should have already pinned! */
|
||||
return msm_obj->sgt;
|
||||
int npages = obj->size >> PAGE_SHIFT;
|
||||
|
||||
if (WARN_ON(!msm_obj->pages)) /* should have already pinned! */
|
||||
return NULL;
|
||||
|
||||
return drm_prime_pages_to_sg(msm_obj->pages, npages);
|
||||
}
|
||||
|
||||
void *msm_gem_prime_vmap(struct drm_gem_object *obj)
|
||||
|
|
Loading…
Reference in a new issue