mirror of
https://github.com/opnsense/src.git
synced 2026-04-21 22:27:47 -04:00
Check that amrd_sc is non-NULL before dereferencing it, not after.
Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor)
This commit is contained in:
parent
cd8aaf2121
commit
9a6caa1afc
1 changed files with 2 additions and 2 deletions
|
|
@ -157,9 +157,9 @@ amrd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t l
|
|||
|
||||
dp = arg;
|
||||
amrd_sc = (struct amrd_softc *)dp->d_drv1;
|
||||
amr_sc = (struct amr_softc *)amrd_sc->amrd_controller;
|
||||
if (!amrd_sc || !amr_sc)
|
||||
if (amrd_sc == NULL)
|
||||
return(ENXIO);
|
||||
amr_sc = (struct amr_softc *)amrd_sc->amrd_controller;
|
||||
|
||||
if (length > 0) {
|
||||
int driveno = amrd_sc->amrd_drive - amr_sc->amr_drive;
|
||||
|
|
|
|||
Loading…
Reference in a new issue