mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 13:46:25 +00:00
Fix possible crash in scst_sched_session_free() because sess got while it's being destroyed after its recf counter already reached 0. To pre
vent that it's better to take reference to sess_kobj instead. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2044 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2213,7 +2213,7 @@ static int scst_sysfs_sess_get_active_commands(struct scst_session *sess)
|
||||
res = active_cmds;
|
||||
|
||||
out_put:
|
||||
scst_sess_put(sess);
|
||||
kobject_put(&sess->sess_kobj);
|
||||
|
||||
TRACE_EXIT_RES(res);
|
||||
return res;
|
||||
@@ -2240,7 +2240,7 @@ static ssize_t scst_sess_sysfs_active_commands_show(struct kobject *kobj,
|
||||
|
||||
work->sess = sess;
|
||||
|
||||
scst_sess_get(sess);
|
||||
kobject_get(&sess->sess_kobj);
|
||||
|
||||
res = scst_sysfs_queue_wait_work(work);
|
||||
if (res != -EAGAIN)
|
||||
|
||||
Reference in New Issue
Block a user