Thread (6 messages) flat view 6 messages, 2 authors, 2014-07-11

Re: [PATCH] farsync: fix invalid memory accesses in fst_add_one() and fst_init_card()

From: Alexey Khoroshilov <hidden>
Date: 2014-07-08 22:40:40
Also in: lkml

On 08.07.2014 18:20, David Miller wrote:
From: Alexey Khoroshilov <redacted>
Date: Sat,  5 Jul 2014 03:35:50 +0400
quoted
-                }
+			card->nports = i;
+			return (card->nports == 0) ? err : 0;
+		}
I don't think this is the right thing to do.

This will cause the caller to not free the IRQ or any of the
other resources.
My understanding of the existing code is to proceed if at least one port
is available.
So I return error code if no ports available at all, otherwise
initialization continues and can succeed.
If something else goes wrong, all resources are deallocated.

Do you suggest to return error code unconditionally?

--
Alexey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help