From: Gleb C. <lna...@ya...> - 2024-02-16 11:31:01
|
Commit: ce2ba13 GitHub URL: https://github.com/SCST-project/scst/commit/ce2ba13bed42c975a048fc56774d425774ad632c Author: Gleb Chesnokov Date: 2024-02-16T14:30:39+03:00 Log Message: ----------- scst_vdisk: Fix check for blockio device Suppress the following (false positive) Coverity complaint: CID 347415: (#1 of 1): Dereference after null check (FORWARD_NULL) var_deref_model: Passing null pointer virt_dev->bdev_handle to bdev_release_backport, which dereferences it Modified Paths: -------------- .gitignore | 1 + scst/src/dev_handlers/scst_vdisk.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) =================================================================== diff --git a/.gitignore b/.gitignore index 60d04ac..bcb84e6 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ *.sdtstub.S *~ .cache.mk +.cache/ .ctf .depend_adm .depend_d diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 2d044cc..4e52a22 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -1335,7 +1335,7 @@ static int vdisk_open_fd(struct scst_vdisk_dev *virt_dev, bool read_only) * For block devices, get the optimal I/O size from the block device * characteristics. */ - if (virt_dev->bdev_handle && !virt_dev->opt_trans_len_set) + if (virt_dev->blockio && !virt_dev->opt_trans_len_set) virt_dev->opt_trans_len = bdev_io_opt(virt_dev->bdev_handle->bdev) ? : virt_dev->opt_trans_len; |