Date: Tue, 11 Mar 2014 01:41:10 +0000 (UTC) From: John-Mark Gurney <jmg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262993 - head/sys/opencrypto Message-ID: <201403110141.s2B1fACl081644@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jmg Date: Tue Mar 11 01:41:09 2014 New Revision: 262993 URL: http://svnweb.freebsd.org/changeset/base/262993 Log: some minor clean up.. Always _ZERO memory so mtx_init won't panic... use the proper macro instead of hand rolling it... Reviewed by: jhb (only the malloc change) MFC after: 1 week Modified: head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptosoft.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Tue Mar 11 01:10:44 2014 (r262992) +++ head/sys/opencrypto/cryptodev.c Tue Mar 11 01:41:09 2014 (r262993) @@ -1044,12 +1044,7 @@ csecreate(struct fcrypt *fcr, u_int64_t { struct csession *cse; -#ifdef INVARIANTS - /* NB: required when mtx_init is built with INVARIANTS */ cse = malloc(sizeof(struct csession), M_XDATA, M_NOWAIT | M_ZERO); -#else - cse = malloc(sizeof(struct csession), M_XDATA, M_NOWAIT); -#endif if (cse == NULL) return NULL; mtx_init(&cse->lock, "cryptodev", "crypto session lock", MTX_DEF); Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Tue Mar 11 01:10:44 2014 (r262992) +++ head/sys/opencrypto/cryptosoft.c Tue Mar 11 01:41:09 2014 (r262993) @@ -1003,7 +1003,7 @@ swcr_process(device_t dev, struct crypto goto done; } - lid = crp->crp_sid & 0xffffffff; + lid = CRYPTO_SESID2LID(crp->crp_sid); rw_rlock(&swcr_sessions_lock); if (swcr_sessions == NULL || lid >= swcr_sesnum || lid == 0 || swcr_sessions[lid] == NULL) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403110141.s2B1fACl081644>