summaryrefslogtreecommitdiffstats
path: root/arch/nds32/kernel
diff options
context:
space:
mode:
authorGreentime Hu <greentime@andestech.com>2018-07-18 09:54:55 +0800
committerGreentime Hu <greentime@andestech.com>2018-09-04 14:45:15 +0800
commit1dfdf99106668679b0de5a62fd4f42c1a11c9445 (patch)
tree213aaf362dec982cbcf3d397ff71f1d82d2eb22b /arch/nds32/kernel
parent57361846b52bc686112da6ca5368d11210796804 (diff)
downloadlinux-stable-1dfdf99106668679b0de5a62fd4f42c1a11c9445.tar.gz
linux-stable-1dfdf99106668679b0de5a62fd4f42c1a11c9445.tar.bz2
linux-stable-1dfdf99106668679b0de5a62fd4f42c1a11c9445.zip
nds32: fix logic for module
This bug is report by Dan Carpenter. We shall use ~loc_mask instead of !loc_mask because we need to and(&) the bits of ~loc_mask. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: c9a4a8da6baa ("nds32: Loadable modules") Signed-off-by: Greentime Hu <greentime@andestech.com>
Diffstat (limited to 'arch/nds32/kernel')
-rw-r--r--arch/nds32/kernel/module.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/nds32/kernel/module.c b/arch/nds32/kernel/module.c
index 4167283d8293..1e31829cbc2a 100644
--- a/arch/nds32/kernel/module.c
+++ b/arch/nds32/kernel/module.c
@@ -40,7 +40,7 @@ void do_reloc16(unsigned int val, unsigned int *loc, unsigned int val_mask,
tmp2 = tmp & loc_mask;
if (partial_in_place) {
- tmp &= (!loc_mask);
+ tmp &= (~loc_mask);
tmp =
tmp2 | ((tmp + ((val & val_mask) >> val_shift)) & val_mask);
} else {
@@ -70,7 +70,7 @@ void do_reloc32(unsigned int val, unsigned int *loc, unsigned int val_mask,
tmp2 = tmp & loc_mask;
if (partial_in_place) {
- tmp &= (!loc_mask);
+ tmp &= (~loc_mask);
tmp =
tmp2 | ((tmp + ((val & val_mask) >> val_shift)) & val_mask);
} else {