Don't attempt to reference sc before testing whether it's NULL.

Submitted by:	Sascha Wildner
Obtained from:	DragonFly
MFC after:	2 weeks
This commit is contained in:
Xin LI 2013-03-22 22:46:19 +00:00
parent 776816d32b
commit 843b298e62
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248627

View file

@ -261,7 +261,6 @@ mfi_disk_strategy(struct bio *bio)
struct mfi_softc *controller;
sc = bio->bio_disk->d_drv1;
controller = sc->ld_controller;
if (sc == NULL) {
bio->bio_error = EINVAL;
@ -271,6 +270,7 @@ mfi_disk_strategy(struct bio *bio)
return;
}
controller = sc->ld_controller;
if (controller->adpreset) {
bio->bio_error = EBUSY;
return;