1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-20 15:43:16 +00:00

check copyin+copyout return values when processing TWA_IOCTL_GET_LOCK

Noticed by:	Coverity Prevent analysis tool
This commit is contained in:
Sam Leffler 2005-03-27 00:29:37 +00:00
parent 155fb57323
commit 4a8bef25fe
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144169

View File

@ -831,8 +831,9 @@ twa_ioctl(struct twa_softc *sc, int cmd, void *buf)
cur_time = time_second - (tz_minuteswest * 60) -
(wall_cmos_clock ? adjkerntz : 0);
copyin(user_buf->pdata, &twa_lock,
sizeof(struct twa_lock_packet));
if ((error = copyin(user_buf->pdata, &twa_lock,
sizeof(struct twa_lock_packet))) != 0)
break;
s = splcam();
if ((sc->twa_ioctl_lock.lock == TWA_LOCK_FREE) ||
(twa_lock.force_flag) ||
@ -850,8 +851,9 @@ twa_ioctl(struct twa_softc *sc, int cmd, void *buf)
TWA_ERROR_IOCTL_LOCK_ALREADY_HELD;
}
splx(s);
copyout(&twa_lock, user_buf->pdata,
sizeof(struct twa_lock_packet));
if ((error = copyout(&twa_lock, user_buf->pdata,
sizeof(struct twa_lock_packet))) != 0)
twa_printf(sc, "get_lock: Could not copyout to lock packet. error = %x\n", error);
break;
}