Skip to content

Commit

Permalink
Initialize the session variable to an impossible session to prevent c…
Browse files Browse the repository at this point in the history
…ompiler

warnings.
  • Loading branch information
zoulasc committed Jan 16, 2020
1 parent 4e87985 commit d807e8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sys/opencrypto/cryptodev.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: cryptodev.c,v 1.102 2019/11/29 08:30:30 hikaru Exp $ */
/* $NetBSD: cryptodev.c,v 1.103 2020/01/16 15:29:24 christos Exp $ */
/* $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $ */
/* $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $ */

Expand Down Expand Up @@ -64,7 +64,7 @@
*/

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.102 2019/11/29 08:30:30 hikaru Exp $");
__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.103 2020/01/16 15:29:24 christos Exp $");

#include <sys/param.h>
#include <sys/systm.h>
Expand Down Expand Up @@ -1787,6 +1787,7 @@ cryptodev_msession(struct fcrypt *fcr, struct session_n_op *sn_ops,
s_op.key = sn_ops->key;
s_op.mackeylen = sn_ops->mackeylen;
s_op.mackey = sn_ops->mackey;
s_op.ses = ~0;

sn_ops->status = cryptodev_session(fcr, &s_op);

Expand Down
5 changes: 3 additions & 2 deletions sys/opencrypto/ocryptodev.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: ocryptodev.c,v 1.14 2019/12/12 02:15:43 pgoyette Exp $ */
/* $NetBSD: ocryptodev.c,v 1.15 2020/01/16 15:29:24 christos Exp $ */
/* $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $ */
/* $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $ */

Expand Down Expand Up @@ -69,7 +69,7 @@
*/

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ocryptodev.c,v 1.14 2019/12/12 02:15:43 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: ocryptodev.c,v 1.15 2020/01/16 15:29:24 christos Exp $");

#include <sys/param.h>
#include <sys/systm.h>
Expand Down Expand Up @@ -279,6 +279,7 @@ ocryptodev_msession(struct fcrypt *fcr, struct osession_n_op *osn_ops,
os_op.key = osn_ops->key;
os_op.mackeylen = osn_ops->mackeylen;
os_op.mackey = osn_ops->mackey;
os_op.ses = ~0;

osn_ops->status = ocryptodev_session(fcr, &os_op);
osn_ops->ses = os_op.ses;
Expand Down

0 comments on commit d807e8a

Please sign in to comment.