aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2010-12-06 17:01:10 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2010-12-06 17:01:10 +0000
commit0fc35b30e3c8ec22ff9df29329de46327879f077 (patch)
treebb164f053e7486e15a3ef79e9e2c09dd2ce77cde /target/linux/generic
parent3945267a9959321fa966d4cc9d87b02f82d34a32 (diff)
downloadupstream-0fc35b30e3c8ec22ff9df29329de46327879f077.tar.gz
upstream-0fc35b30e3c8ec22ff9df29329de46327879f077.tar.bz2
upstream-0fc35b30e3c8ec22ff9df29329de46327879f077.zip
kernel: fix cryptodev with kernel >= 2.6.35
The fix is from http://sourceforge.net/mailarchive/forum.php?thread_name=20100906035717.GA7562%40mcafee.com&forum_name=ocf-linux-users Thank you tripolar for reporting the issue and finding a solution for it. SVN-Revision: 24286
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/files/crypto/ocf/cryptodev.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/target/linux/generic/files/crypto/ocf/cryptodev.c b/target/linux/generic/files/crypto/ocf/cryptodev.c
index c1e9140a05..f7ce06bc12 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) {