When freeing session, restore its ID after zeroing memory.

Bug tracked down by:	Patrick Lamaiziere <patfbsd@davenulle.org>
This commit is contained in:
Pawel Jakub Dawidek 2008-08-09 19:43:44 +00:00
parent 7d8b54b5b5
commit eadca5921d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181474

View File

@ -272,6 +272,7 @@ padlock_freesession(device_t dev, uint64_t tid)
padlock_hash_free(ses);
bzero(ses, sizeof(*ses));
ses->ses_used = 0;
ses->ses_id = sid;
TAILQ_INSERT_HEAD(&sc->sc_sessions, ses, ses_next);
rw_wunlock(&sc->sc_sessions_lock);
return (0);