Make sure there is a device before opening. Fixes NULL access

when opening unattached devices.
This commit is contained in:
Peter Dufault 1995-03-03 21:38:43 +00:00
parent 50d387a36e
commit 1ea3a7260a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6863

View File

@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: scsi_ioctl.c,v 1.10 1995/01/19 12:41:36 dufault Exp $
* $Id: scsi_driver.c,v 1.1 1995/03/01 22:24:41 dufault Exp $
*
*/
#include <sys/types.h>
@ -89,6 +89,9 @@ scsi_open(dev_t dev, int flags, struct scsi_device *device)
u_int32 unit;
struct scsi_link *sc_link;
if (device == 0)
return ENXIO;
unit = GETUNIT(device, dev);
sc_link = SCSI_LINK(device, unit);