NVMe: check the return of nvme_alloc_iod
PATCH 1/1 NVMe: check the return of nvme_alloc_iod
It maybe failed due to out of memory.
Cc Matthew Wilcox <[email protected]>
Cc Keith Busch <[email protected]>
Signed-off-by Yuanhan Liu <[email protected]>
--- drivers/block/nvme.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/block/nvme.c +4 -0
@@ -1091,6 +1091,10 @@ static struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write, } iod =nvme_alloc_iod (count, length,GFP_KERNEL ); +if (!iod) { + err = -ENOMEM ; + goto put_pages; + } sg = iod->sg;sg_init_table (sg, count);for (i =0 ; i < count; i++) {
Signature · 1 line
1.7.7.6