From 82d831be8080bc36c3567378d67ec34608571e28 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 8 Dec 2015 04:16:01 +0000 Subject: [PATCH] scst_event: fix forgotten corner case module_put git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6723 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_event.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_event.c b/scst/src/scst_event.c index 3b36b8e50..c7af51a4f 100644 --- a/scst/src/scst_event.c +++ b/scst/src/scst_event.c @@ -866,7 +866,7 @@ static int scst_event_create_priv(struct file *file) PRINT_ERROR("Unable to allocate priv (size %zd)", sizeof(*priv)); res = -ENOMEM; - goto out; + goto out_put; } TRACE_MEM("priv %p allocated", priv); @@ -891,6 +891,10 @@ static int scst_event_create_priv(struct file *file) out: TRACE_EXIT_RES(res); return res; + +out_put: + module_put(THIS_MODULE); + goto out; } static long scst_event_ioctl(struct file *file, unsigned int cmd,