Don't take attr if dpbp == NULL! OW does some optimizations assuming that

NULL does not point to valid memory, in this case it hurts.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@969 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-05-29 01:33:12 +00:00
parent 7a9c620d82
commit 41edf4f640
1 changed files with 4 additions and 13 deletions

View File

@ -228,7 +228,10 @@ COUNT DosDevIOctl(lregs * r)
#endif #endif
dpbp = get_dpb(CharReqHdr.r_unit); dpbp = get_dpb(CharReqHdr.r_unit);
attr = dpbp->dpb_device->dh_attr; if (dpbp)
attr = dpbp->dpb_device->dh_attr;
else if (r->AL != 9)
return DE_INVLDDRV;
switch (r->AL) switch (r->AL)
{ {
@ -239,10 +242,6 @@ COUNT DosDevIOctl(lregs * r)
nMode = C_IOCTLOUT; nMode = C_IOCTLOUT;
goto IoBlockCommon; goto IoBlockCommon;
case 0x08: case 0x08:
if (!dpbp)
{
return DE_INVLDDRV;
}
if (attr & ATTR_EXCALLS) if (attr & ATTR_EXCALLS)
{ {
nMode = C_REMMEDIA; nMode = C_REMMEDIA;
@ -277,10 +276,6 @@ COUNT DosDevIOctl(lregs * r)
case 0x11: case 0x11:
nMode = C_IOCTLQRY; nMode = C_IOCTLQRY;
IoBlockCommon: IoBlockCommon:
if (!dpbp)
{
return DE_INVLDDRV;
}
if (r->AL == 0x0D && (r->CX & ~(0x486B-0x084A)) == 0x084A) if (r->AL == 0x0D && (r->CX & ~(0x486B-0x084A)) == 0x084A)
{ /* 084A/484A, 084B/484B, 086A/486A, 086B/486B */ { /* 084A/484A, 084B/484B, 086A/486A, 086B/486B */
r->AX = 0; /* (lock/unlock logical/physical volume) */ r->AX = 0; /* (lock/unlock logical/physical volume) */
@ -315,10 +310,6 @@ COUNT DosDevIOctl(lregs * r)
default: /* 0x0f */ default: /* 0x0f */
nMode = C_SETLDEV; nMode = C_SETLDEV;
IoLogCommon: IoLogCommon:
if (!dpbp)
{
return DE_INVLDDRV;
}
if (attr & ATTR_GENIOCTL) if (attr & ATTR_GENIOCTL)
{ {