From 2238c4da8cea7d057d3591d28efe307ef4079015 Mon Sep 17 00:00:00 2001 From: Alexander Lobakin Date: Fri, 16 Jul 2021 17:19:15 +0800 Subject: [PATCH] skbuff: constify skb_propagate_pfmemalloc() "page" argument mainline inclusion from mainline-v5.12-rc1-dontuse commit 48f971c9c80a728646fc03367a28df747f20d0f4 category: feature bugzilla: 173966 CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=48f971c9c80a728646fc03367a28df747f20d0f4 ---------------------------------------------------------------------- The function doesn't write anything to the page struct itself, so this argument can be const. Misc: align second argument to the brace while at it. Signed-off-by: Alexander Lobakin Reviewed-by: Jesse Brandeburg Acked-by: David Rientjes Signed-off-by: Jakub Kicinski Reviewed-by: Yongxin Li Signed-off-by: Zheng Zengkai --- include/linux/skbuff.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a828cf99c521..345944698dd4 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -2927,8 +2927,8 @@ static inline struct page *dev_alloc_page(void) * @page: The page that was allocated from skb_alloc_page * @skb: The skb that may need pfmemalloc set */ -static inline void skb_propagate_pfmemalloc(struct page *page, - struct sk_buff *skb) +static inline void skb_propagate_pfmemalloc(const struct page *page, + struct sk_buff *skb) { if (page_is_pfmemalloc(page)) skb->pfmemalloc = true; -- GitLab