diff options
author | Mike Isely <isely@pobox.com> | 2006-02-26 16:00:20 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-02-26 16:00:20 -0600 |
commit | 555a4680960f6297f0e4cdead5f8a48e3e3b9cfe (patch) | |
tree | 52c9475b64e5b42c8e47f481590b6eaa6e434305 /linux/drivers/media | |
parent | 70d1bdb4e801ae6b0c29d2f103225c966b9eded4 (diff) | |
download | mediapointer-dvb-s2-555a4680960f6297f0e4cdead5f8a48e3e3b9cfe.tar.gz mediapointer-dvb-s2-555a4680960f6297f0e4cdead5f8a48e3e3b9cfe.tar.bz2 |
Log a message if a pvrusb2 I2C write is too large
From: Mike Isely <isely@pobox.com>
The wire protocol to the PVR USB2 hardware limits the total size of an
I2C write transfer (among other things). The driver detects this case
and fails the transfer; this change also logs the message. We need
this in order to catch V4L modules which might be attempting such
transfers and deal with them on a case-by-case basis.
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 9 |
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); |