You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
NVMe: fix error return code in nvme_submit_bio_queue()
nvme_submit_flush_data() might overwrite the initialisation of the return value with 0, so move the -ENOMEM setting close to the usage. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
This commit is contained in:
committed by
Matthew Wilcox
parent
5460fc0310
commit
1287dabd34
@@ -629,7 +629,7 @@ static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns,
|
|||||||
struct nvme_command *cmnd;
|
struct nvme_command *cmnd;
|
||||||
struct nvme_iod *iod;
|
struct nvme_iod *iod;
|
||||||
enum dma_data_direction dma_dir;
|
enum dma_data_direction dma_dir;
|
||||||
int cmdid, length, result = -ENOMEM;
|
int cmdid, length, result;
|
||||||
u16 control;
|
u16 control;
|
||||||
u32 dsmgmt;
|
u32 dsmgmt;
|
||||||
int psegs = bio_phys_segments(ns->queue, bio);
|
int psegs = bio_phys_segments(ns->queue, bio);
|
||||||
@@ -640,6 +640,7 @@ static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result = -ENOMEM;
|
||||||
iod = nvme_alloc_iod(psegs, bio->bi_size, GFP_ATOMIC);
|
iod = nvme_alloc_iod(psegs, bio->bi_size, GFP_ATOMIC);
|
||||||
if (!iod)
|
if (!iod)
|
||||||
goto nomem;
|
goto nomem;
|
||||||
|
|||||||
Reference in New Issue
Block a user