summaryrefslogtreecommitdiff
path: root/net/netlabel/netlabel_kapi.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2020-06-08 10:14:49 -0700
committerTony Lindgren <tony@atomide.com>2020-06-08 10:14:49 -0700
commit4263eb6880df8383fff0efb872278a99eb6142c8 (patch)
tree67ab9bf228e4f5f341f9408e055180932b39fe06 /net/netlabel/netlabel_kapi.c
parent636338d7968e47c7f2e0b772a2a825ad932883fb (diff)
parent8e326a8bdef3fb42b92bf2742e8405d9b9209367 (diff)
Merge branch 'fixes-v5.7' into fixes
Diffstat (limited to 'net/netlabel/netlabel_kapi.c')
-rw-r--r--net/netlabel/netlabel_kapi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
index 409a3ae47ce2..5e1239cef000 100644
--- a/net/netlabel/netlabel_kapi.c
+++ b/net/netlabel/netlabel_kapi.c
@@ -734,6 +734,12 @@ int netlbl_catmap_getlong(struct netlbl_lsm_catmap *catmap,
if ((off & (BITS_PER_LONG - 1)) != 0)
return -EINVAL;
+ /* a null catmap is equivalent to an empty one */
+ if (!catmap) {
+ *offset = (u32)-1;
+ return 0;
+ }
+
if (off < catmap->startbit) {
off = catmap->startbit;
*offset = off;