diff --git a/net/core/scm.c b/net/core/scm.c index 574607b1c2d9..8076f091003f 100644 --- a/net/core/scm.c +++ b/net/core/scm.c @@ -371,7 +371,7 @@ struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl) if (!fpl) return NULL; - new_fpl = kmemdup(fpl, offsetof(struct scm_fp_list, fp[fpl->count]), + new_fpl = kmemdup(fpl, sizeof(*fpl), GFP_KERNEL_ACCOUNT); if (new_fpl) { for (i = 0; i < fpl->count; i++)