diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c
index 54298fcd82f0e1b540cee1eb3d9cfc5df2512c0b..a4f9a150812a33a5f4cd9ccebe9eb6a7acc4b326 100644
--- a/net/netfilter/nft_payload.c
+++ b/net/netfilter/nft_payload.c
@@ -84,7 +84,7 @@ void nft_payload_eval(const struct nft_expr *expr,
 
 	switch (priv->base) {
 	case NFT_PAYLOAD_LL_HEADER:
-		if (!skb_mac_header_was_set(skb))
+		if (!skb_mac_header_was_set(skb) || skb_mac_header_len(skb) == 0)
 			goto err;
 
 		if (skb_vlan_tag_present(skb)) {