diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2012-09-20 14:57:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-21 15:14:20 -0400 |
commit | a9e8d1a6b87167116e5779378f1d25ffed2e833b (patch) | |
tree | 71a06afb1bfb55617f2198235b9948398550b0f1 /arch/sparc | |
parent | dfa520af2c20aa3c75f0497d49165561212a1c6f (diff) |
sparc: fix the return value of module_alloc()
In case of error, function module_alloc() in other platform never
returns ERR_PTR(), and all of the user only check for NULL, so
we'd better return NULL instead of ERR_PTR().
dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/module.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c index bae6ab600b7f..f1ddc0d23679 100644 --- a/arch/sparc/kernel/module.c +++ b/arch/sparc/kernel/module.c | |||
@@ -48,9 +48,7 @@ void *module_alloc(unsigned long size) | |||
48 | return NULL; | 48 | return NULL; |
49 | 49 | ||
50 | ret = module_map(size); | 50 | ret = module_map(size); |
51 | if (!ret) | 51 | if (ret) |
52 | ret = ERR_PTR(-ENOMEM); | ||
53 | else | ||
54 | memset(ret, 0, size); | 52 | memset(ret, 0, size); |
55 | 53 | ||
56 | return ret; | 54 | return ret; |