diff options
author | wzt.wzt@gmail.com <wzt.wzt@gmail.com> | 2010-04-09 07:30:29 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-04-09 01:13:48 -0400 |
commit | c1a7368a6f0b18b10fdec87972da680ebdf03794 (patch) | |
tree | 17a8d306fe2332093e0e11e5fbb03199df011037 /security/selinux/selinuxfs.c | |
parent | e2902eb79fdea3c3bf679a8f15f3432b393cb2c0 (diff) |
Security: Fix coding style in security/
Fix coding style in security/
Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/selinuxfs.c')
-rw-r--r-- | security/selinux/selinuxfs.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index cd191bbec03..0293843f7ed 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c | |||
@@ -503,11 +503,11 @@ static ssize_t sel_write_access(struct file *file, char *buf, size_t size) | |||
503 | return length; | 503 | return length; |
504 | 504 | ||
505 | length = -ENOMEM; | 505 | length = -ENOMEM; |
506 | scon = kzalloc(size+1, GFP_KERNEL); | 506 | scon = kzalloc(size + 1, GFP_KERNEL); |
507 | if (!scon) | 507 | if (!scon) |
508 | return length; | 508 | return length; |
509 | 509 | ||
510 | tcon = kzalloc(size+1, GFP_KERNEL); | 510 | tcon = kzalloc(size + 1, GFP_KERNEL); |
511 | if (!tcon) | 511 | if (!tcon) |
512 | goto out; | 512 | goto out; |
513 | 513 | ||
@@ -515,10 +515,10 @@ static ssize_t sel_write_access(struct file *file, char *buf, size_t size) | |||
515 | if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) | 515 | if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) |
516 | goto out2; | 516 | goto out2; |
517 | 517 | ||
518 | length = security_context_to_sid(scon, strlen(scon)+1, &ssid); | 518 | length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); |
519 | if (length < 0) | 519 | if (length < 0) |
520 | goto out2; | 520 | goto out2; |
521 | length = security_context_to_sid(tcon, strlen(tcon)+1, &tsid); | 521 | length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); |
522 | if (length < 0) | 522 | if (length < 0) |
523 | goto out2; | 523 | goto out2; |
524 | 524 | ||
@@ -550,11 +550,11 @@ static ssize_t sel_write_create(struct file *file, char *buf, size_t size) | |||
550 | return length; | 550 | return length; |
551 | 551 | ||
552 | length = -ENOMEM; | 552 | length = -ENOMEM; |
553 | scon = kzalloc(size+1, GFP_KERNEL); | 553 | scon = kzalloc(size + 1, GFP_KERNEL); |
554 | if (!scon) | 554 | if (!scon) |
555 | return length; | 555 | return length; |
556 | 556 | ||
557 | tcon = kzalloc(size+1, GFP_KERNEL); | 557 | tcon = kzalloc(size + 1, GFP_KERNEL); |
558 | if (!tcon) | 558 | if (!tcon) |
559 | goto out; | 559 | goto out; |
560 | 560 | ||
@@ -562,10 +562,10 @@ static ssize_t sel_write_create(struct file *file, char *buf, size_t size) | |||
562 | if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) | 562 | if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) |
563 | goto out2; | 563 | goto out2; |
564 | 564 | ||
565 | length = security_context_to_sid(scon, strlen(scon)+1, &ssid); | 565 | length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); |
566 | if (length < 0) | 566 | if (length < 0) |
567 | goto out2; | 567 | goto out2; |
568 | length = security_context_to_sid(tcon, strlen(tcon)+1, &tsid); | 568 | length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); |
569 | if (length < 0) | 569 | if (length < 0) |
570 | goto out2; | 570 | goto out2; |
571 | 571 | ||
@@ -609,11 +609,11 @@ static ssize_t sel_write_relabel(struct file *file, char *buf, size_t size) | |||
609 | return length; | 609 | return length; |
610 | 610 | ||
611 | length = -ENOMEM; | 611 | length = -ENOMEM; |
612 | scon = kzalloc(size+1, GFP_KERNEL); | 612 | scon = kzalloc(size + 1, GFP_KERNEL); |
613 | if (!scon) | 613 | if (!scon) |
614 | return length; | 614 | return length; |
615 | 615 | ||
616 | tcon = kzalloc(size+1, GFP_KERNEL); | 616 | tcon = kzalloc(size + 1, GFP_KERNEL); |
617 | if (!tcon) | 617 | if (!tcon) |
618 | goto out; | 618 | goto out; |
619 | 619 | ||
@@ -621,10 +621,10 @@ static ssize_t sel_write_relabel(struct file *file, char *buf, size_t size) | |||
621 | if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) | 621 | if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) |
622 | goto out2; | 622 | goto out2; |
623 | 623 | ||
624 | length = security_context_to_sid(scon, strlen(scon)+1, &ssid); | 624 | length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); |
625 | if (length < 0) | 625 | if (length < 0) |
626 | goto out2; | 626 | goto out2; |
627 | length = security_context_to_sid(tcon, strlen(tcon)+1, &tsid); | 627 | length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); |
628 | if (length < 0) | 628 | if (length < 0) |
629 | goto out2; | 629 | goto out2; |
630 | 630 | ||
@@ -666,11 +666,11 @@ static ssize_t sel_write_user(struct file *file, char *buf, size_t size) | |||
666 | return length; | 666 | return length; |
667 | 667 | ||
668 | length = -ENOMEM; | 668 | length = -ENOMEM; |
669 | con = kzalloc(size+1, GFP_KERNEL); | 669 | con = kzalloc(size + 1, GFP_KERNEL); |
670 | if (!con) | 670 | if (!con) |
671 | return length; | 671 | return length; |
672 | 672 | ||
673 | user = kzalloc(size+1, GFP_KERNEL); | 673 | user = kzalloc(size + 1, GFP_KERNEL); |
674 | if (!user) | 674 | if (!user) |
675 | goto out; | 675 | goto out; |
676 | 676 | ||
@@ -678,7 +678,7 @@ static ssize_t sel_write_user(struct file *file, char *buf, size_t size) | |||
678 | if (sscanf(buf, "%s %s", con, user) != 2) | 678 | if (sscanf(buf, "%s %s", con, user) != 2) |
679 | goto out2; | 679 | goto out2; |
680 | 680 | ||
681 | length = security_context_to_sid(con, strlen(con)+1, &sid); | 681 | length = security_context_to_sid(con, strlen(con) + 1, &sid); |
682 | if (length < 0) | 682 | if (length < 0) |
683 | goto out2; | 683 | goto out2; |
684 | 684 | ||
@@ -727,11 +727,11 @@ static ssize_t sel_write_member(struct file *file, char *buf, size_t size) | |||
727 | return length; | 727 | return length; |
728 | 728 | ||
729 | length = -ENOMEM; | 729 | length = -ENOMEM; |
730 | scon = kzalloc(size+1, GFP_KERNEL); | 730 | scon = kzalloc(size + 1, GFP_KERNEL); |
731 | if (!scon) | 731 | if (!scon) |
732 | return length; | 732 | return length; |
733 | 733 | ||
734 | tcon = kzalloc(size+1, GFP_KERNEL); | 734 | tcon = kzalloc(size + 1, GFP_KERNEL); |
735 | if (!tcon) | 735 | if (!tcon) |
736 | goto out; | 736 | goto out; |
737 | 737 | ||
@@ -739,10 +739,10 @@ static ssize_t sel_write_member(struct file *file, char *buf, size_t size) | |||
739 | if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) | 739 | if (sscanf(buf, "%s %s %hu", scon, tcon, &tclass) != 3) |
740 | goto out2; | 740 | goto out2; |
741 | 741 | ||
742 | length = security_context_to_sid(scon, strlen(scon)+1, &ssid); | 742 | length = security_context_to_sid(scon, strlen(scon) + 1, &ssid); |
743 | if (length < 0) | 743 | if (length < 0) |
744 | goto out2; | 744 | goto out2; |
745 | length = security_context_to_sid(tcon, strlen(tcon)+1, &tsid); | 745 | length = security_context_to_sid(tcon, strlen(tcon) + 1, &tsid); |
746 | if (length < 0) | 746 | if (length < 0) |
747 | goto out2; | 747 | goto out2; |
748 | 748 | ||
@@ -1401,7 +1401,7 @@ static int sel_make_perm_files(char *objclass, int classvalue, | |||
1401 | } | 1401 | } |
1402 | inode->i_fop = &sel_perm_ops; | 1402 | inode->i_fop = &sel_perm_ops; |
1403 | /* i+1 since perm values are 1-indexed */ | 1403 | /* i+1 since perm values are 1-indexed */ |
1404 | inode->i_ino = sel_perm_to_ino(classvalue, i+1); | 1404 | inode->i_ino = sel_perm_to_ino(classvalue, i + 1); |
1405 | d_add(dentry, inode); | 1405 | d_add(dentry, inode); |
1406 | } | 1406 | } |
1407 | 1407 | ||
@@ -1489,7 +1489,7 @@ static int sel_make_classes(void) | |||
1489 | goto out; | 1489 | goto out; |
1490 | 1490 | ||
1491 | /* +2 since classes are 1-indexed */ | 1491 | /* +2 since classes are 1-indexed */ |
1492 | last_class_ino = sel_class_to_ino(nclasses+2); | 1492 | last_class_ino = sel_class_to_ino(nclasses + 2); |
1493 | 1493 | ||
1494 | for (i = 0; i < nclasses; i++) { | 1494 | for (i = 0; i < nclasses; i++) { |
1495 | struct dentry *class_name_dir; | 1495 | struct dentry *class_name_dir; |
@@ -1506,7 +1506,7 @@ static int sel_make_classes(void) | |||
1506 | goto out1; | 1506 | goto out1; |
1507 | 1507 | ||
1508 | /* i+1 since class values are 1-indexed */ | 1508 | /* i+1 since class values are 1-indexed */ |
1509 | rc = sel_make_class_dir_entries(classes[i], i+1, | 1509 | rc = sel_make_class_dir_entries(classes[i], i + 1, |
1510 | class_name_dir); | 1510 | class_name_dir); |
1511 | if (rc) | 1511 | if (rc) |
1512 | goto out1; | 1512 | goto out1; |