summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslm <slm@FreeBSD.org>2016-05-09 16:34:06 +0000
committerslm <slm@FreeBSD.org>2016-05-09 16:34:06 +0000
commit5ad95da0d51e2be4ff785c5cea49df99784c2025 (patch)
treea26d171e35062c8d7a6cd2a9bb2e48d3525c2a2e
parentc4c7b1c9922c950d5121df85298d0a98518effe7 (diff)
downloadFreeBSD-src-5ad95da0d51e2be4ff785c5cea49df99784c2025.zip
FreeBSD-src-5ad95da0d51e2be4ff785c5cea49df99784c2025.tar.gz
done_ccb pointer can be used if it is NULL.
To prevent this, move check for done_ccb == NULL to before done_ccb is used in mprsas_stop_unit_done(). Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6099
-rw-r--r--sys/dev/mpr/mpr_sas_lsi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c
index 4ede5f7..640338a 100644
--- a/sys/dev/mpr/mpr_sas_lsi.c
+++ b/sys/dev/mpr/mpr_sas_lsi.c
@@ -1272,15 +1272,15 @@ mprsas_stop_unit_done(struct cam_periph *periph, union ccb *done_ccb)
struct mprsas_softc *sassc;
char path_str[64];
+ if (done_ccb == NULL)
+ return;
+
sassc = (struct mprsas_softc *)done_ccb->ccb_h.ppriv_ptr1;
xpt_path_string(done_ccb->ccb_h.path, path_str, sizeof(path_str));
mpr_dprint(sassc->sc, MPR_INFO, "Completing stop unit for %s\n",
path_str);
- if (done_ccb == NULL)
- return;
-
/*
* Nothing more to do except free the CCB and path. If the command
* timed out, an abort reset, then target reset will be issued during
OpenPOWER on IntegriCloud