diff mbox

[5/6] lirc_zilog: error out if buffer read bytes != chunk size

Message ID 1300307071-19665-6-git-send-email-jarod@redhat.com (mailing list archive)
State Accepted
Headers show

Commit Message

Jarod Wilson March 16, 2011, 8:24 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/staging/lirc/lirc_zilog.c b/drivers/staging/lirc/lirc_zilog.c
index 407d4b4..5ada643 100644
--- a/drivers/staging/lirc/lirc_zilog.c
+++ b/drivers/staging/lirc/lirc_zilog.c
@@ -950,6 +950,10 @@  static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)
 				ret = copy_to_user((void *)outbuf+written, buf,
 						   rbuf->chunk_size);
 				written += rbuf->chunk_size;
+			} else {
+				zilog_error("Buffer read failed!\n");
+				ret = -EIO;
+				break;
 			}
 		}
 	}