[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1513711816-2618-33-git-send-email-dongwon.kim@intel.com>
Date: Tue, 19 Dec 2017 11:29:49 -0800
From: Dongwon Kim <dongwon.kim@...el.com>
To: linux-kernel@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org, xen-devel@...ts.xenproject.org,
mateuszx.potrola@...el.com, dongwon.kim@...el.com
Subject: [RFC PATCH 33/60] hyper_dmabuf: error checking on the result of dma_buf_map_attachment
From: Mateusz Polrola <mateuszx.potrola@...el.com>
Added error checking on the result of function call,
dma_buf_map_attachment
Signed-off-by: Dongwon Kim <dongwon.kim@...el.com>
---
drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c b/drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c
index c0048d9..476c0d7 100644
--- a/drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c
+++ b/drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c
@@ -149,6 +149,11 @@ static int hyper_dmabuf_export_remote(struct file *filp, void *data)
sgt = dma_buf_map_attachment(attachment, DMA_BIDIRECTIONAL);
+ if (IS_ERR(sgt)) {
+ dev_err(hyper_dmabuf_private.device, "Cannot map attachment\n");
+ return PTR_ERR(sgt);
+ }
+
sgt_info = kcalloc(1, sizeof(*sgt_info), GFP_KERNEL);
if(!sgt_info) {
--
2.7.4
Powered by blists - more mailing lists