From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 14 19:43:10 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB5191065679 for ; Sat, 14 Jun 2008 19:43:10 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from smtp.lamaiziere.net (net.lamaiziere.net [213.186.42.107]) by mx1.freebsd.org (Postfix) with ESMTP id 80F988FC23 for ; Sat, 14 Jun 2008 19:43:10 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from baby-jane.lamaiziere.net (15.10.87-79.rev.gaoland.net [79.87.10.15]) by smtp.lamaiziere.net (Postfix) with ESMTP id 353DF1180596 for ; Sat, 14 Jun 2008 21:43:09 +0200 (CEST) Received: from baby-jane-lamaiziere-net.local (localhost [127.0.0.1]) by baby-jane.lamaiziere.net (Postfix) with ESMTP id 9DBDC44A166 for ; Sat, 14 Jun 2008 21:43:08 +0200 (CEST) Date: Sat, 14 Jun 2008 21:43:06 +0200 From: Patrick =?ISO-8859-15?Q?Lamaizi=E8re?= To: freebsd-hackers@freebsd.org Message-ID: <20080614214306.079e279f@baby-jane-lamaiziere-net.local> Organization: /dave/nulle X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.8; i386-apple-darwin9.2.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: padlock(4) bug or feature ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2008 19:43:10 -0000 Hello, 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 ? Regards.