[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220924141728.3343-1-liujing@cmss.chinamobile.com>
Date: Sat, 24 Sep 2022 10:17:28 -0400
From: liujing <liujing@...s.chinamobile.com>
To: vgoyal@...hat.com
Cc: stefanha@...hat.com, miklos@...redi.hu,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
liujing <liujing@...s.chinamobile.com>
Subject: [PATCH] virtio_fs.c: add check kmalloc return
Signed-off-by: liujing <liujing@...s.chinamobile.com>
---
fs/fuse/virtio_fs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index 4d8d4f16c727..07334c9c2883 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -989,6 +989,10 @@ __releases(fiq->lock)
/* Allocate a buffer for the request */
forget = kmalloc(sizeof(*forget), GFP_NOFS | __GFP_NOFAIL);
+
+ if (forget == NULL)
+ return -ENOMEM;
+
req = &forget->req;
req->ih = (struct fuse_in_header){
--
2.18.2
Powered by blists - more mailing lists