diff options
author | Hector Palacios <hector.palacios@digi.com> | 2011-02-16 10:22:29 +0100 |
---|---|---|
committer | Hector Palacios <hector.palacios@digi.com> | 2011-02-16 10:25:00 +0100 |
commit | faf1127cfc728eb33c3dc120ee8698938f3eae75 (patch) | |
tree | b22693633b7fcad8e6f2e1a180c52d1937557f9d /crypto | |
parent | 3a5fb2258ea28dd13fdcc479a6ee38f1845374b7 (diff) |
cryptodev: override private_data in 2.6.35
On 2.6.35 private_data points to a miscdevice structure, we override
it, which is currently safe to do.
Patch taken from http://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg07521.html
Signed-off-by: Hector Palacios <hector.palacios@digi.com>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/ocf/cryptodev.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/ocf/cryptodev.c b/crypto/ocf/cryptodev.c index 13d57a11fd7e..58c096828aae 100644 --- a/crypto/ocf/cryptodev.c +++ b/crypto/ocf/cryptodev.c @@ -964,10 +964,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) { |