summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
index e682538ef..d3b223d09 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
@@ -51,7 +51,14 @@ static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */
#endif
if (!data) length = 0;
- if (length > (sizeof(hdw->cmd_buffer) - 3)) return -ENOTSUPP;
+ if (length > (sizeof(hdw->cmd_buffer) - 3)) {
+ pvr2_trace(PVR2_TRACE_ERROR_LEGS,
+ "Killing an I2C write to %u that is too large"
+ " (desired=%u limit=%u)",
+ i2c_addr,
+ length,(sizeof(hdw->cmd_buffer) - 3));
+ return -ENOTSUPP;
+ }
LOCK_TAKE(hdw->ctl_lock);