mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] qxl: correctly handling failed allocation
@ 2015-12-29 19:17 Insu Yun
  2015-12-29 19:26 ` kbuild test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Insu Yun @ 2015-12-29 19:17 UTC (permalink / raw)
  To: airlied, dri-devel, linux-kernel
  Cc: taesoo, yeongjin.jang, insu, changwoo, Insu Yun

Since kmalloc can be failed in memory pressure, 
when fails, return error code.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
 drivers/gpu/drm/qxl/qxl_kms.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c
index b2977a1..2e99854 100644
--- a/drivers/gpu/drm/qxl/qxl_kms.c
+++ b/drivers/gpu/drm/qxl/qxl_kms.c
@@ -221,6 +221,9 @@ static int qxl_device_init(struct qxl_device *qdev,
 		kmalloc(qdev->n_mem_slots * sizeof(struct qxl_memslot),
 			GFP_KERNEL);
 
+	if (!qdev->memslots)
+		return -ENOMEM;
+
 	idr_init(&qdev->release_idr);
 	spin_lock_init(&qdev->release_idr_lock);
 	spin_lock_init(&qdev->release_lock);
-- 
1.9.1


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

end of thread, other threads:[~2016-07-09 13:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-29 19:17 [PATCH] qxl: correctly handling failed allocation Insu Yun
2015-12-29 19:26 ` kbuild test robot
2015-12-29 19:26 ` kbuild test robot
2016-07-09 13:41 ` kbuild test robot

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®