~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to security/tomoyo/common.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
                        head->read_user_buf += len;
109
109
                        w += len;
110
110
                }
111
 
                if (*w) {
112
 
                        head->r.w[0] = w;
 
111
                head->r.w[0] = w;
 
112
                if (*w)
113
113
                        return false;
114
 
                }
115
114
                /* Add '\0' for query. */
116
115
                if (head->poll) {
117
116
                        if (!head->read_user_buf_avail ||
459
458
        if (profile == &tomoyo_default_profile)
460
459
                return -EINVAL;
461
460
        if (!strcmp(data, "COMMENT")) {
462
 
                const struct tomoyo_path_info *old_comment = profile->comment;
463
 
                profile->comment = tomoyo_get_name(cp);
 
461
                static DEFINE_SPINLOCK(lock);
 
462
                const struct tomoyo_path_info *new_comment
 
463
                        = tomoyo_get_name(cp);
 
464
                const struct tomoyo_path_info *old_comment;
 
465
                if (!new_comment)
 
466
                        return -ENOMEM;
 
467
                spin_lock(&lock);
 
468
                old_comment = profile->comment;
 
469
                profile->comment = new_comment;
 
470
                spin_unlock(&lock);
464
471
                tomoyo_put_name(old_comment);
465
472
                return 0;
466
473
        }