storage: fix cert-c issue in storage driver

Using this patch we are fixing below cert error:-
1. var_deref_model: Passing null pointer bio_req to req_op,
   which dereferences it.

CID 10177627

Bug 3512545

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: Id9c71a82d3adf52590816fa87b53a8965da5c105
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2933682
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Manish Bhardwaj
2023-07-10 16:19:08 +05:30
committed by mobile promotions
parent ff572997a3
commit 5d872b9a0d

View File

@@ -437,6 +437,7 @@ static bool complete_bio_req(struct vblk_dev *vblkdev)
dev_err(vblkdev->device, dev_err(vblkdev->device,
"VSC request %d has null bio request!\n", "VSC request %d has null bio request!\n",
vsc_req->id); vsc_req->id);
goto bio_null;
} }
if ((!vblkdev->config.blk_config.use_vm_address && READ_WRITE_OR_IOCTL_OP) if ((!vblkdev->config.blk_config.use_vm_address && READ_WRITE_OR_IOCTL_OP)
@@ -448,6 +449,7 @@ static bool complete_bio_req(struct vblk_dev *vblkdev)
vblkdev->mempool_free = vblkdev->mempool_free + vsc_req->__data_len; vblkdev->mempool_free = vblkdev->mempool_free + vsc_req->__data_len;
} }
bio_null:
vblk_put_req(vsc_req); vblk_put_req(vsc_req);
complete_bio_exit: complete_bio_exit: