[RHEL7,COMMIT] fuse kio: Use dereferenced cs in cslist_destroy()

Submitted by Konstantin Khorenko on June 8, 2018, 4:29 p.m.

Details

Message ID 201806081629.w58GTxdC020482@finist_ce7.work
State New
Series "fuse kio: Use dereferenced cs in cslist_destroy()"
Headers show

Commit Message

Konstantin Khorenko June 8, 2018, 4:29 p.m.
The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.50.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.50.7
------>
commit a9618cd934cdf2980fcb995d65cf42aaedc21f68
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Fri Jun 8 19:29:59 2018 +0300

    fuse kio: Use dereferenced cs in cslist_destroy()
    
    Do not dereference cs twice, since the second time it may be already NULL.
    
    Reported-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/kio/pcs/pcs_map.c b/fs/fuse/kio/pcs/pcs_map.c
index f105eae8863a..b8bcda778959 100644
--- a/fs/fuse/kio/pcs/pcs_map.c
+++ b/fs/fuse/kio/pcs/pcs_map.c
@@ -74,7 +74,7 @@  static void cslist_destroy(struct pcs_cs_list * csl)
 			list_del_init(&cslink->link);
 			cs->nmaps--;
 		}
-		spin_unlock(&cslink->cs->lock);
+		spin_unlock(&cs->lock);
 	}
 	rcu_read_unlock();
 	kfree(csl);