diff options
author | Mike Isely <isely@pobox.com> | 2006-04-20 00:21:36 -0500 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-04-20 00:21:36 -0500 |
commit | a38e144fad1d09381623675a1442f2811d7ccc66 (patch) | |
tree | 348c5b48c1ef09da7d5d8b11b8c1ccffab9773c3 /linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | |
parent | d678f2eed5e7c30fc3976ef3e8293221ff2c0bea (diff) | |
download | mediapointer-dvb-s2-a38e144fad1d09381623675a1442f2811d7ccc66.tar.gz mediapointer-dvb-s2-a38e144fad1d09381623675a1442f2811d7ccc66.tar.bz2 |
Log a warning message on a too-large I2C read attempt in pvrusb2
From: Mike Isely <isely@pobox.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index 6d7c909ce..232dea53f 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -112,8 +112,22 @@ static int pvr2_i2c_read(struct pvr2_hdw *hdw, /* Context */ #endif if (!data) dlen = 0; - if (dlen > (sizeof(hdw->cmd_buffer) - 4)) return -ENOTSUPP; - if (res && (rlen > (sizeof(hdw->cmd_buffer) - 1))) return -ENOTSUPP; + if (dlen > (sizeof(hdw->cmd_buffer) - 4)) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Killing an I2C read to %u that has wlen too large" + " (desired=%u limit=%u)", + i2c_addr, + dlen,(unsigned int)(sizeof(hdw->cmd_buffer) - 4)); + return -ENOTSUPP; + } + if (res && (rlen > (sizeof(hdw->cmd_buffer) - 1))) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Killing an I2C read to %u that has rlen too large" + " (desired=%u limit=%u)", + i2c_addr, + rlen,(unsigned int)(sizeof(hdw->cmd_buffer) - 1)); + return -ENOTSUPP; + } LOCK_TAKE(hdw->ctl_lock); |