x86: return proper error code
Subsystems (3)
PATCH RESEND 1/1 x86: return proper error code
x86: return -ENOMEM instead of -1 when returning on memory allocation errors in add_kmmio_fault_page()
--- arch/x86/mm/kmmio.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/mm/kmmio.c +1 -1
@@ -370,7 +370,7 @@ static int add_kmmio_fault_page(unsigned long page) f =kzalloc (sizeof (*f),GFP_ATOMIC );if (!f) -return -1 ; +return -ENOMEM ; f->count =1 ; f->page = page;
Signature · 9 lines
1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Quoted 12 lines · Davidlohr Bueso
x86: return
-ENOMEMinstead of -1 when returning on memory allocation errors inadd_kmmio_fault_page()Signed-off-by Davidlohr Bueso <[email protected]>---
arch/x86/mm/kmmio.c | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/mm/kmmio.c +0
-0
arch/x86/mm/kmmio.c static int add_kmmio_fault_page(unsigned long page) · line 376
Quoted 8 lines
arch/x86/mm/kmmio.c +1
-1@@ -370,7 +370,7 @@ static int add_kmmio_fault_page(unsigned long page) f = kzalloc(sizeof(*f), GFP_ATOMIC); if (!f) - return -1; + return -ENOMEM; f->count = 1; f->page = page;
This doesn't matter much as register_kmmio_probe() doesn't do anything sane with the error code and ioremap_trace_core() ignores what register_mmio_probe() does completely. I'd either keep the code as-is or try to fix up the fishy error handling properly.
Quoted 22 lines · On Thu, 30 Sep 2010 22:49:36 +0300 Pekka Enberg <[email protected]> wrote:
Quoted 20 lines · Davidlohr Bueso
x86: return
-ENOMEMinstead of -1 when returning on memory allocation errors inadd_kmmio_fault_page()Signed-off-by Davidlohr Bueso <[email protected]>---
arch/x86/mm/kmmio.c | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/mm/kmmio.c +1
-1@@ -370,7 +370,7 @@ static int add_kmmio_fault_page(unsigned long page) f = kzalloc(sizeof(*f), GFP_ATOMIC); if (!f) - return -1; + return -ENOMEM;
Quoted 8 lines
Quoted 2 lines
arch/x86/mm/kmmio.c +0
-0f->count = 1;f->page = page;
This doesn't matter much as
register_kmmio_probe()doesn't do anything sane with the error code andioremap_trace_core()ignores whatregister_mmio_probe()does completely. I'd either keep the code as-is or try to fix up the fishy error handling properly.
Yes, I agree completely with Pekka.
Signature · 2 lines
Pekka Paalanen http://www.iki.fi/pq/