Skip to content

Commit

Permalink
scst_vdisk: Fix check for blockio device
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lnocturno committed Feb 16, 2024
1 parent bf6d418 commit ce2ba13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*.sdtstub.S
*~
.cache.mk
.cache/
.ctf
.depend_adm
.depend_d
Expand Down
2 changes: 1 addition & 1 deletion scst/src/dev_handlers/scst_vdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ce2ba13

Please sign in to comment.