diff mbox series

drm/qxl: remove unnecessary BUG_ON check for handle

Message ID 20191205234231.10849-1-pakki001@umn.edu (mailing list archive)
State New, archived
Headers show
Series drm/qxl: remove unnecessary BUG_ON check for handle | expand

Commit Message

Aditya Pakki Dec. 5, 2019, 11:42 p.m. UTC
In qxl_gem_object_create_with_handle(), handle's memory is not
allocated on the heap. Checking for failure of handle via BUG_ON
is unnecessary. This patch eliminates the check.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 drivers/gpu/drm/qxl/qxl_gem.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Gerd Hoffmann Dec. 6, 2019, 10:13 a.m. UTC | #1
On Thu, Dec 05, 2019 at 05:42:31PM -0600, Aditya Pakki wrote:
> In qxl_gem_object_create_with_handle(), handle's memory is not
> allocated on the heap. Checking for failure of handle via BUG_ON
> is unnecessary. This patch eliminates the check.

The check makes sure the caller doesn't pass in handle == NULL
and it is needed.

cheers,
  Gerd
diff mbox series

Patch

diff --git a/drivers/gpu/drm/qxl/qxl_gem.c b/drivers/gpu/drm/qxl/qxl_gem.c
index 69f37db1027a..45b779a8bc22 100644
--- a/drivers/gpu/drm/qxl/qxl_gem.c
+++ b/drivers/gpu/drm/qxl/qxl_gem.c
@@ -84,7 +84,6 @@  int qxl_gem_object_create_with_handle(struct qxl_device *qdev,
 	int r;
 
 	BUG_ON(!qobj);
-	BUG_ON(!handle);
 
 	r = qxl_gem_object_create(qdev, size, 0,
 				  domain,