From: Mathieu Desnoyers Date: Wed, 8 Dec 2010 15:59:42 +0000 (-0500) Subject: Fix open/close X-Git-Tag: v2.0-pre1~202 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c269fff4f141e1376e87c92ae224030849389621;p=lttng-modules.git Fix open/close Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-debugfs-abi.c b/ltt-debugfs-abi.c index 6bc94838..f9b7e9b0 100644 --- a/ltt-debugfs-abi.c +++ b/ltt-debugfs-abi.c @@ -202,7 +202,9 @@ static int lttng_session_release(struct inode *inode, struct file *file) { struct ltt_session *session = file->private_data; - ltt_session_destroy(session); + + if (session) + ltt_session_destroy(session); return 0; } @@ -372,7 +374,9 @@ static int lttng_channel_release(struct inode *inode, struct file *file) { struct ltt_channel *channel = file->private_data; - fput(channel->session->file); + + if (channel) + fput(channel->session->file); return 0; } @@ -392,7 +396,9 @@ static int lttng_event_release(struct inode *inode, struct file *file) { struct ltt_event *event = file->private_data; - fput(event->chan->file); + + if (event) + fput(event->chan->file); return 0; }