diff --git a/drivers/isdn/eicon/linchr.c b/drivers/isdn/eicon/linchr.c index 2d0f71b6aef9714e0df63c5e0bfa0da109d48b60..5f8922173ebc6820b8a6addb68d386d37e6e5043 100644 --- a/drivers/isdn/eicon/linchr.c +++ b/drivers/isdn/eicon/linchr.c @@ -153,17 +153,15 @@ ssize_t do_read(struct file *pFile, char *pUserBuffer, size_t BufferSize, loff_t klog_t *pHeadItem; if (BufferSize < sizeof(klog_t)) - { - printk(KERN_WARNING "Divas: Divalog buffer specifed a size that is too small (%d - %d required)\n", - BufferSize, sizeof(klog_t)); return -EIO; - } pHeadItem = (klog_t *) DivasLogFifoRead(); - if (pHeadItem) - { - memcpy(pClientLogBuffer, pHeadItem, sizeof(klog_t)); + if (pHeadItem) { + if (copy_to_user(pClientLogBuffer, pHeadItem, sizeof(klog_t))) { + kfree(pHeadItem); + return -EFAULT; + } kfree(pHeadItem); return sizeof(klog_t); }