diff --git a/net/dccp/feat.c b/net/dccp/feat.c index 1704948..c90cb35 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c @@ -367,11 +367,11 @@ static inline int dccp_feat_must_be_understood(u8 feat_num) } /* copy constructor, fval must not already contain allocated memory */ -static int dccp_feat_clone_sp_val(dccp_feat_val *fval, u8 const *val, u8 len) +static int dccp_feat_clone_sp_val(dccp_feat_val *fval, u8 const *val, u8 len, gfp_t flags) { fval->sp.len = len; if (fval->sp.len > 0) { - fval->sp.vec = kmemdup(val, len, gfp_any()); + fval->sp.vec = kmemdup(val, len, flags); if (fval->sp.vec == NULL) { fval->sp.len = 0; return -ENOBUFS; @@ -404,7 +404,8 @@ static void dccp_feat_val_destructor(u8 feat_num, dccp_feat_val *val) if (type == FEAT_SP && dccp_feat_clone_sp_val(&new->val, original->val.sp.vec, - original->val.sp.len)) { + original->val.sp.len, + gfp_any())) { kfree(new); return NULL; } @@ -735,7 +736,7 @@ static int __feat_register_sp(struct list_head *fn, u8 feat, u8 is_local, if (feat == DCCPF_CCID && !ccid_support_check(sp_val, sp_len)) return -EOPNOTSUPP; - if (dccp_feat_clone_sp_val(&fval, sp_val, sp_len)) + if (dccp_feat_clone_sp_val(&fval, sp_val, sp_len, gfp_any())) return -ENOMEM; return dccp_feat_push_change(fn, feat, is_local, mandatory, &fval); @@ -1138,7 +1139,7 @@ static u8 dccp_feat_change_recv(struct list_head *fn, u8 is_mandatory, u8 opt, * otherwise we accept the preferred value; * - else if we are the client, we use the first list element. */ - if (dccp_feat_clone_sp_val(&fval, val, 1)) + if (dccp_feat_clone_sp_val(&fval, val, 1, GFP_ATOMIC)) return DCCP_RESET_CODE_TOO_BUSY; if (len > 1 && server) {