Commit a9e8d1a6 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dfa520af
...@@ -48,9 +48,7 @@ void *module_alloc(unsigned long size) ...@@ -48,9 +48,7 @@ void *module_alloc(unsigned long size)
return NULL; return NULL;
ret = module_map(size); ret = module_map(size);
if (!ret) if (ret)
ret = ERR_PTR(-ENOMEM);
else
memset(ret, 0, size); memset(ret, 0, size);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment