[Patch 3/7] tabled: Stub NULL session in events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently ncld has a bug that causes it to report a session failure
when session was not open yet. So, if a session fails to open,
application crashes while trying to print the SID. This problem
made this crash occur easily.

Unfortunately for us, there's more to it. If the library opened
session, but is pre-empted before ncld_sess_open returns, the
same situation may occur legitimately. So this check is still
needed, unless we radically change the locking strategy.

Signed-off-by: Pete Zaitcev <zaitcev@xxxxxxxxxx>

---
 server/cldu.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

commit 446e8ca93ce624797a69841f38081faa369fee4a
Author: Pete Zaitcev <zaitcev@xxxxxxxxx>
Date:   Thu Apr 1 19:09:34 2010 -0600

    Stub the problem with failure to open.

diff --git a/server/cldu.c b/server/cldu.c
index aecf336..fadc3d8 100644
--- a/server/cldu.c
+++ b/server/cldu.c
@@ -176,8 +176,11 @@ static void cldu_sess_event(void *priv, uint32_t what)
 	struct cld_session *sp = priv;
 
 	if (what == CE_SESS_FAILED) {
-		applog(LOG_ERR, "Session failed, sid " SIDFMT,
-			       SIDARG(sp->nsp->udp->sess->sid));
+		if (sp->nsp)
+			applog(LOG_ERR, "Session failed, sid " SIDFMT,
+				       SIDARG(sp->nsp->udp->sess->sid));
+		else
+			applog(LOG_ERR, "Session open failed");
 		sp->is_dead = true;
 	} else {
 		if (sp->nsp)
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux