From ae2d990eede0ef5938c210d48a177c044258ecd8 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Wed, 23 May 2007 13:58:12 -0700 Subject: HiSax: fix error checking for hisax_register()] This patch (as875) adds error-checking to the callers of hisax_register(). It also changes an error pathway in that routine, making it return an error code rather than 0. This fixes Bugzilla #7960. Signed-off-by: Alan Stern Acked-by: Karsten Keil Cc: Martin Bachem Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/isdn/hisax/hisax_fcpcipnp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/isdn/hisax/hisax_fcpcipnp.c') diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c index 9e088fce8c3..7993e01f9fc 100644 --- a/drivers/isdn/hisax/hisax_fcpcipnp.c +++ b/drivers/isdn/hisax/hisax_fcpcipnp.c @@ -859,7 +859,11 @@ new_adapter(void) for (i = 0; i < 2; i++) b_if[i] = &adapter->bcs[i].b_if; - hisax_register(&adapter->isac.hisax_d_if, b_if, "fcpcipnp", protocol); + if (hisax_register(&adapter->isac.hisax_d_if, b_if, "fcpcipnp", + protocol) != 0) { + kfree(adapter); + adapter = NULL; + } return adapter; } -- cgit v1.2.3