diff options
author | Dave Airlie <airlied@redhat.com> | 2009-09-07 20:27:20 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-09-07 20:27:20 +1000 |
commit | 11670d3c93210793562748d83502ecbef4034765 (patch) | |
tree | 9e2c33c6249e26b05a2b5db87d4f4840e9049840 /security | |
parent | 575dc34ee0de867ba83abf25998e0963bff451fa (diff) | |
parent | 01dfba93d9dfcf6d7abfc55ff5d9d6e76fa01ba0 (diff) |
Merge intel drm-intel-next branch
Merge remote branch 'anholt/drm-intel-next' of ../anholt-2.6 into drm-next
Conflicts:
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_sdvo.c
Diffstat (limited to 'security')
-rw-r--r-- | security/integrity/ima/ima_crypto.c | 6 | ||||
-rw-r--r-- | security/integrity/ima/ima_main.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c index 63003a63aae..46642a19bc7 100644 --- a/security/integrity/ima/ima_crypto.c +++ b/security/integrity/ima/ima_crypto.c @@ -45,9 +45,9 @@ int ima_calc_hash(struct file *file, char *digest) { struct hash_desc desc; struct scatterlist sg[1]; - loff_t i_size; + loff_t i_size, offset = 0; char *rbuf; - int rc, offset = 0; + int rc; rc = init_desc(&desc); if (rc != 0) @@ -67,6 +67,8 @@ int ima_calc_hash(struct file *file, char *digest) rc = rbuf_len; break; } + if (rbuf_len == 0) + break; offset += rbuf_len; sg_init_one(sg, rbuf, rbuf_len); diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 101c512564e..4732f5e5d12 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -262,6 +262,8 @@ void ima_counts_put(struct path *path, int mask) else if (mask & (MAY_READ | MAY_EXEC)) iint->readcount--; mutex_unlock(&iint->mutex); + + kref_put(&iint->refcount, iint_free); } /* @@ -291,6 +293,8 @@ void ima_counts_get(struct file *file) if (file->f_mode & FMODE_WRITE) iint->writecount++; mutex_unlock(&iint->mutex); + + kref_put(&iint->refcount, iint_free); } EXPORT_SYMBOL_GPL(ima_counts_get); |