From: Wei Yongjun Date: Thu, 20 Sep 2012 18:57:51 +0000 (+0000) Subject: sparc: fix the return value of module_alloc() X-Git-Tag: upstream/snapshot3+hdmi~6547^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9e8d1a6b87167116e5779378f1d25ffed2e833b;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: David S. Miller --- diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c index bae6ab6..f1ddc0d 100644 --- a/arch/sparc/kernel/module.c +++ b/arch/sparc/kernel/module.c @@ -48,9 +48,7 @@ void *module_alloc(unsigned long size) return NULL; ret = module_map(size); - if (!ret) - ret = ERR_PTR(-ENOMEM); - else + if (ret) memset(ret, 0, size); return ret;