Don't dereference a pointer immediately after determining that it is

equal to NULL. [1]

While I'm here, s/xb/xbd/ (the name changed a long time ago but this
instance wasn't corrected).

Reported by:	PVS-Studio [1]
This commit is contained in:
cperciva 2016-02-14 13:42:16 +00:00
parent 9e3e4b8857
commit bc9b18cea2

View File

@ -674,7 +674,7 @@ xbd_open(struct disk *dp)
struct xbd_softc *sc = dp->d_drv1;
if (sc == NULL) {
printf("xb%d: not found", sc->xbd_unit);
printf("xbd%d: not found", dp->d_unit);
return (ENXIO);
}