mirror of https://github.com/hak5/openwrt.git
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: 24286lede-17.01
parent
3945267a99
commit
0fc35b30e3
|
@ -977,10 +977,16 @@ cryptodev_open(struct inode *inode, struct file *filp)
|
||||||
struct fcrypt *fcr;
|
struct fcrypt *fcr;
|
||||||
|
|
||||||
dprintk("%s()\n", __FUNCTION__);
|
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) {
|
if (filp->private_data) {
|
||||||
printk("cryptodev: Private data already exists !\n");
|
printk("cryptodev: Private data already exists - %p!\n", filp->private_data);
|
||||||
return(0);
|
return(-ENODEV);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
fcr = kmalloc(sizeof(*fcr), GFP_KERNEL);
|
fcr = kmalloc(sizeof(*fcr), GFP_KERNEL);
|
||||||
if (!fcr) {
|
if (!fcr) {
|
||||||
|
|
Loading…
Reference in New Issue