summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin M. Forbes <jforbes@fedoraproject.org>2022-01-31 16:09:58 -0600
committerJustin M. Forbes <jforbes@fedoraproject.org>2022-01-31 16:09:58 -0600
commitb10cd81878dd00f723deb20b4f2f675722f6a4e8 (patch)
tree421b56b589906be2df0f5cf54bf51a2a91797422
parentf760a275cec0a8dda88e2cde5c0cd8fc133283cc (diff)
downloadkernel-b10cd81878dd00f723deb20b4f2f675722f6a4e8.tar.gz
kernel-b10cd81878dd00f723deb20b4f2f675722f6a4e8.tar.xz
kernel-b10cd81878dd00f723deb20b4f2f675722f6a4e8.zip
One more gcc 12 fix up
Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
-rw-r--r--patch-5.17-redhat.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/patch-5.17-redhat.patch b/patch-5.17-redhat.patch
index 9529dbb10..77def27fb 100644
--- a/patch-5.17-redhat.patch
+++ b/patch-5.17-redhat.patch
@@ -3210,3 +3210,34 @@ index c2d2ab9a2861..f5bed94e4558 100644
struct reloc *rel;
int idx;
+From 102756c4df1ea2f55dd6a9de3f22f9304194d0e6 Mon Sep 17 00:00:00 2001
+From: "Justin M. Forbes" <jforbes@fedoraproject.org>
+Date: Mon, 31 Jan 2022 12:55:43 -0600
+Subject: [PATCH] Fix gcc 12 warning address of 'mem_section' will never be
+ NULL
+
+Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
+---
+ include/linux/mmzone.h | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
+index aed44e9b5d89..9eeaa7e10771 100644
+--- a/include/linux/mmzone.h
++++ b/include/linux/mmzone.h
+@@ -1390,11 +1390,9 @@ static inline unsigned long *section_to_usemap(struct mem_section *ms)
+ static inline struct mem_section *__nr_to_section(unsigned long nr)
+ {
+ #ifdef CONFIG_SPARSEMEM_EXTREME
+- if (!mem_section)
++ if (!mem_section || !mem_section[SECTION_NR_TO_ROOT(nr)])
+ return NULL;
+ #endif
+- if (!mem_section[SECTION_NR_TO_ROOT(nr)])
+- return NULL;
+ return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK];
+ }
+ extern size_t mem_section_usage_size(void);
+--
+2.34.1
+