From: Stephen Rothwell Date: Wed, 20 Feb 2013 02:13:21 +0000 (+1100) Subject: Merge remote-tracking branch 'net-next/master' X-Git-Tag: next-20130220~68 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5309df50dc45b907f00bc2514beb03f654c3374f;p=karo-tx-linux.git Merge remote-tracking branch 'net-next/master' Conflicts: arch/mips/include/uapi/asm/socket.h crypto/ctr.c --- 5309df50dc45b907f00bc2514beb03f654c3374f diff --cc arch/mips/include/uapi/asm/socket.h index cc208f9f8920,3e68bfbda6bc..47132f44c955 --- a/arch/mips/include/uapi/asm/socket.h +++ b/arch/mips/include/uapi/asm/socket.h @@@ -28,12 -28,10 +28,10 @@@ #define SO_LINGER 0x0080 /* Block on close of a reliable socket to transmit pending data. */ #define SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. */ - #if 0 - To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ - #endif + #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ #define SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */ -#define SO_STYLE SO_TYPE /* Synonym */ +#define SO_STYLE SO_TYPE /* Synonym */ #define SO_ERROR 0x1007 /* get error status and clear */ #define SO_SNDBUF 0x1001 /* Send buffer size. */ #define SO_RCVBUF 0x1002 /* Receive buffer. */ diff --cc crypto/ctr.c index 095dcb66d72d,1f2997cbfdd4..f2b94f27bb2c --- a/crypto/ctr.c +++ b/crypto/ctr.c @@@ -324,18 -335,40 +335,38 @@@ static void crypto_rfc3686_exit_tfm(str static struct crypto_instance *crypto_rfc3686_alloc(struct rtattr **tb) { + struct crypto_attr_type *algt; struct crypto_instance *inst; struct crypto_alg *alg; + struct crypto_skcipher_spawn *spawn; + const char *cipher_name; int err; - err = crypto_check_attr_type(tb, CRYPTO_ALG_TYPE_BLKCIPHER); + algt = crypto_get_attr_type(tb); - err = PTR_ERR(algt); + if (IS_ERR(algt)) - return ERR_PTR(err); ++ return ERR_CAST(algt); + + if ((algt->type ^ CRYPTO_ALG_TYPE_BLKCIPHER) & algt->mask) + return ERR_PTR(-EINVAL); + + cipher_name = crypto_attr_alg_name(tb[1]); - err = PTR_ERR(cipher_name); + if (IS_ERR(cipher_name)) - return ERR_PTR(err); ++ return ERR_CAST(cipher_name); + + inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); + if (!inst) + return ERR_PTR(-ENOMEM); + + spawn = crypto_instance_ctx(inst); + + crypto_set_skcipher_spawn(spawn, inst); + err = crypto_grab_skcipher(spawn, cipher_name, 0, + crypto_requires_sync(algt->type, + algt->mask)); if (err) - return ERR_PTR(err); + goto err_free_inst; - alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_BLKCIPHER, - CRYPTO_ALG_TYPE_MASK); - if (IS_ERR(alg)) - return ERR_CAST(alg); + alg = crypto_skcipher_spawn_alg(spawn); /* We only support 16-byte blocks. */ err = -EINVAL;