X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/c5552ad03973839d83d32d7108f20c00f192633b..a3978a4a410391558c991944340bcf6941c9c916:/target/linux/generic/files/crypto/ocf/cryptodev.c?ds=sidebyside diff --git a/target/linux/generic/files/crypto/ocf/cryptodev.c b/target/linux/generic/files/crypto/ocf/cryptodev.c index 87a4c379d..f7ce06bc1 100644 --- a/target/linux/generic/files/crypto/ocf/cryptodev.c +++ b/target/linux/generic/files/crypto/ocf/cryptodev.c @@ -977,10 +977,16 @@ cryptodev_open(struct inode *inode, struct file *filp) struct fcrypt *fcr; dprintk("%s()\n", __FUNCTION__); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) + /* + * on 2.6.35 private_data points to a miscdevice structure, we override + * it, which is currently safe to do. + */ if (filp->private_data) { - printk("cryptodev: Private data already exists !\n"); - return(0); + printk("cryptodev: Private data already exists - %p!\n", filp->private_data); + return(-ENODEV); } +#endif fcr = kmalloc(sizeof(*fcr), GFP_KERNEL); if (!fcr) { @@ -1019,7 +1025,9 @@ static struct file_operations cryptodev_fops = { .owner = THIS_MODULE, .open = cryptodev_open, .release = cryptodev_release, +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) .ioctl = cryptodev_ioctl, +#endif #ifdef HAVE_UNLOCKED_IOCTL .unlocked_ioctl = cryptodev_unlocked_ioctl, #endif