diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 8da28517714e..e66a4f640b2c 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -483,8 +483,10 @@ ata_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct threa break; case ATAREINIT: - if (!device || !(ch = device_get_softc(device))) - return ENXIO; + if (!device || !(ch = device_get_softc(device))) { + error = ENXIO; + break; + } error = ata_reinit(ch); ata_start(ch); break;