aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/keys/proc.c')
-rw-r--r--security/keys/proc.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/security/keys/proc.c b/security/keys/proc.c
index 624c650c2efd..9d01021ca0c8 100644
--- a/security/keys/proc.c
+++ b/security/keys/proc.c
@@ -209,11 +209,9 @@ static int proc_keys_show(struct seq_file *m, void *v)
209 /* come up with a suitable timeout value */ 209 /* come up with a suitable timeout value */
210 if (key->expiry == 0) { 210 if (key->expiry == 0) {
211 memcpy(xbuf, "perm", 5); 211 memcpy(xbuf, "perm", 5);
212 } 212 } else if (now.tv_sec >= key->expiry) {
213 else if (now.tv_sec >= key->expiry) {
214 memcpy(xbuf, "expd", 5); 213 memcpy(xbuf, "expd", 5);
215 } 214 } else {
216 else {
217 timo = key->expiry - now.tv_sec; 215 timo = key->expiry - now.tv_sec;
218 216
219 if (timo < 60) 217 if (timo < 60)
@@ -253,9 +251,7 @@ static int proc_keys_show(struct seq_file *m, void *v)
253 seq_putc(m, '\n'); 251 seq_putc(m, '\n');
254 252
255 rcu_read_unlock(); 253 rcu_read_unlock();
256
257 return 0; 254 return 0;
258
259} 255}
260 256
261#endif /* CONFIG_KEYS_DEBUG_PROC_KEYS */ 257#endif /* CONFIG_KEYS_DEBUG_PROC_KEYS */
@@ -281,6 +277,7 @@ static struct rb_node *key_user_first(struct rb_root *r)
281 struct rb_node *n = rb_first(r); 277 struct rb_node *n = rb_first(r);
282 return __key_user_next(n); 278 return __key_user_next(n);
283} 279}
280
284/*****************************************************************************/ 281/*****************************************************************************/
285/* 282/*
286 * implement "/proc/key-users" to provides a list of the key users 283 * implement "/proc/key-users" to provides a list of the key users
@@ -288,7 +285,6 @@ static struct rb_node *key_user_first(struct rb_root *r)
288static int proc_key_users_open(struct inode *inode, struct file *file) 285static int proc_key_users_open(struct inode *inode, struct file *file)
289{ 286{
290 return seq_open(file, &proc_key_users_ops); 287 return seq_open(file, &proc_key_users_ops);
291
292} 288}
293 289
294static void *proc_key_users_start(struct seq_file *p, loff_t *_pos) 290static void *proc_key_users_start(struct seq_file *p, loff_t *_pos)
@@ -306,14 +302,12 @@ static void *proc_key_users_start(struct seq_file *p, loff_t *_pos)
306 } 302 }
307 303
308 return _p; 304 return _p;
309
310} 305}
311 306
312static void *proc_key_users_next(struct seq_file *p, void *v, loff_t *_pos) 307static void *proc_key_users_next(struct seq_file *p, void *v, loff_t *_pos)
313{ 308{
314 (*_pos)++; 309 (*_pos)++;
315 return key_user_next((struct rb_node *) v); 310 return key_user_next((struct rb_node *) v);
316
317} 311}
318 312
319static void proc_key_users_stop(struct seq_file *p, void *v) 313static void proc_key_users_stop(struct seq_file *p, void *v)