Merge tag 'intel-gpio-v6.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy...
[linux-2.6-block.git] / drivers / net / ethernet / intel / ixgbe / ixgbe_ipsec.c
index 13a6fca31004a8e1c69d7b8a994b5da93ca08b3c..866024f2b9eeb380d31557b53f2c7e00fe41a15a 100644 (file)
@@ -914,7 +914,13 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
                goto err_out;
        }
 
-       xs = kzalloc(sizeof(*xs), GFP_KERNEL);
+       algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1);
+       if (unlikely(!algo)) {
+               err = -ENOENT;
+               goto err_out;
+       }
+
+       xs = kzalloc(sizeof(*xs), GFP_ATOMIC);
        if (unlikely(!xs)) {
                err = -ENOMEM;
                goto err_out;
@@ -930,14 +936,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
                memcpy(&xs->id.daddr.a4, sam->addr, sizeof(xs->id.daddr.a4));
        xs->xso.dev = adapter->netdev;
 
-       algo = xfrm_aead_get_byname(aes_gcm_name, IXGBE_IPSEC_AUTH_BITS, 1);
-       if (unlikely(!algo)) {
-               err = -ENOENT;
-               goto err_xs;
-       }
-
        aead_len = sizeof(*xs->aead) + IXGBE_IPSEC_KEY_BITS / 8;
-       xs->aead = kzalloc(aead_len, GFP_KERNEL);
+       xs->aead = kzalloc(aead_len, GFP_ATOMIC);
        if (unlikely(!xs->aead)) {
                err = -ENOMEM;
                goto err_xs;