Re: [PATCH] st: fix potential null pointer dereference.

2015-11-18 Thread Maurizio Lombardi
Please ignore this one, I sent a V2 On 11/18/2015 02:18 PM, Maurizio Lombardi wrote: > If cdev_add() returns an error, the code calls > cdev_del() passing the STm->cdevs[rew] pointer as parameter; > the problem is that the pointer has not been initialized yet. > > This patch fixes the problem by

[PATCH] st: fix potential null pointer dereference.

2015-11-18 Thread Maurizio Lombardi
If cdev_add() returns an error, the code calls cdev_del() passing the STm->cdevs[rew] pointer as parameter; the problem is that the pointer has not been initialized yet. This patch fixes the problem by moving the STm->cdevs[rew] pointer initialization before the call to cdev_add(). It also sets ST