On Fri, Sep 14, 2018 at 3:12 PM Christian König <[email protected]> wrote: > > Just free the BO if the size is should be zero. > > Signed-off-by: Christian König <[email protected]>
Reviewed-by: Alex Deucher <[email protected]> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > index e1f32a196f6d..d282e923d1b4 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > @@ -250,6 +250,11 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev, > bool free = false; > int r; > > + if (!size) { > + amdgpu_bo_unref(bo_ptr); > + return 0; > + } > + > memset(&bp, 0, sizeof(bp)); > bp.size = size; > bp.byte_align = align; > -- > 2.14.1 > > _______________________________________________ > amd-gfx mailing list > [email protected] > https://lists.freedesktop.org/mailman/listinfo/amd-gfx _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
