From: Wei Yongjun Date: Thu, 20 Sep 2012 18:57:51 +0000 (+0000) Subject: sparc: fix the return value of module_alloc() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a9e8d1a6b87167116e5779378f1d25ffed2e833b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 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) return NULL; ret = module_map(size); - if (!ret) - ret = ERR_PTR(-ENOMEM); - else + if (ret) memset(ret, 0, size); return ret;