linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/qxl: remove unnecessary BUG_ON check for handle
@ 2019-12-05 23:42 Aditya Pakki
  2019-12-06 10:13 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2019-12-05 23:42 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Dave Airlie, Gerd Hoffmann, David Airlie, Daniel Vetter,
	virtualization, spice-devel, dri-devel, linux-kernel

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(-)

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,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/qxl: remove unnecessary BUG_ON check for handle
  2019-12-05 23:42 [PATCH] drm/qxl: remove unnecessary BUG_ON check for handle Aditya Pakki
@ 2019-12-06 10:13 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2019-12-06 10:13 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: kjlu, Dave Airlie, David Airlie, Daniel Vetter, virtualization,
	spice-devel, dri-devel, linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-06 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 23:42 [PATCH] drm/qxl: remove unnecessary BUG_ON check for handle Aditya Pakki
2019-12-06 10:13 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).