Hi Nikos,

I think I've missed an important case with this patch: filp->private_data 
should be set immediately after kzalloc to address the failure of this one too.

Regards,
Cristian S.


> diff --git a/ioctl.c b/ioctl.c
> index e918e8d..53f2719 100644
> --- a/ioctl.c
> +++ b/ioctl.c
> @@ -454,6 +454,7 @@ cryptodev_open(struct inode *inode, struct file
> *filp)
>       pcr = kzalloc(sizeof(*pcr), GFP_KERNEL);
>       if (!pcr)
>               return -ENOMEM;
> +     filp->private_data = pcr;
> 
>       mutex_init(&pcr->fcrypt.sem);
>       INIT_LIST_HEAD(&pcr->fcrypt.list);
> @@ -477,7 +478,6 @@ cryptodev_open(struct inode *inode, struct file
> *filp)
>               list_add(&tmp->__hook, &pcr->free.list);
>       }
> 
> -     filp->private_data = pcr;
>       dprintk(2, KERN_DEBUG,
>               "Cryptodev handle initialised, %d elements in queue\n",
>               DEF_COP_RINGSIZE);
> --



_______________________________________________
Cryptodev-linux-devel mailing list
Cryptodev-linux-devel@gna.org
https://mail.gna.org/listinfo/cryptodev-linux-devel

Reply via email to