padlock(4) bug or feature ?

Patrick Lamaizière patfbsd at
Sat Jun 14 19:43:10 UTC 2008


I was looking the code of padlock(4).

In padlock_newsession(), when there is an error we call
padlock_freesession with dev == NULL

by sample :
error = padlock_cipher_setup(ses, encini);
if (error != 0) {
	padlock_freesession(NULL, ses->ses_id);
	return (error);

But padlock_freesession() uses dev to get the softc.

static int
padlock_freesession(device_t dev, uint64_t tid)
	struct padlock_softc *sc = device_get_softc(dev)

I'm asking how it can work with dev == NULL ?


More information about the freebsd-hackers mailing list