Fix NULL pointer dereference in zio_ready()
Clang's static analyzer correctly identified a NULL pointer dereference in zio_ready() when ZIO_FLAG_NODATA has been set on a zio that is missing a block pointer. The NULL pointer dereference occurs because we have logic intended to disable ZIO_FLAG_NODATA when it has been set on a gang block. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Brian Atkinson <batkinson@lanl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #14469
This commit is contained in:
parent
c9e39da9a4
commit
7cb67d627c
|
@ -4431,7 +4431,7 @@ zio_ready(zio_t *zio)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zio->io_flags & ZIO_FLAG_NODATA) {
|
if (zio->io_flags & ZIO_FLAG_NODATA) {
|
||||||
if (BP_IS_GANG(bp)) {
|
if (bp != NULL && BP_IS_GANG(bp)) {
|
||||||
zio->io_flags &= ~ZIO_FLAG_NODATA;
|
zio->io_flags &= ~ZIO_FLAG_NODATA;
|
||||||
} else {
|
} else {
|
||||||
ASSERT((uintptr_t)zio->io_abd < SPA_MAXBLOCKSIZE);
|
ASSERT((uintptr_t)zio->io_abd < SPA_MAXBLOCKSIZE);
|
||||||
|
|
Loading…
Reference in New Issue