Re: [PATCH 2/2] drivers: staging: wilc1000: Call kfree only for error cases

2015-10-04 Thread Chandra Gorentla
On Sun, Oct 04, 2015 at 09:44:57AM +0100, Greg KH wrote: > On Sat, Oct 03, 2015 at 02:57:30PM +0530, Chandra S Gorentla wrote: > > - kfree is being called for the members of the queue without > >de-queuing them; they are just inserted within this function; > >they are supposed to be

Re: [PATCH 1/2] drivers: staging: wilc1000: Move spin lock to the start of critical section

2015-10-04 Thread Chandra Gorentla
On Sun, Oct 04, 2015 at 09:43:35AM +0100, Greg KH wrote: > On Sat, Oct 03, 2015 at 02:57:29PM +0530, Chandra S Gorentla wrote: > > The spin_lock_irqsave is moved to just beginning of critical section. > > This change moves a couple of return statements out of the lock. > > > > Signed-off-by:

Re: [PATCH 1/2] drivers: staging: wilc1000: Move spin lock to the start of critical section

2015-10-04 Thread Chandra Gorentla
On Sun, Oct 04, 2015 at 09:43:35AM +0100, Greg KH wrote: > On Sat, Oct 03, 2015 at 02:57:29PM +0530, Chandra S Gorentla wrote: > > The spin_lock_irqsave is moved to just beginning of critical section. > > This change moves a couple of return statements out of the lock. > > > > Signed-off-by:

Re: [PATCH 2/2] drivers: staging: wilc1000: Call kfree only for error cases

2015-10-04 Thread Chandra Gorentla
On Sun, Oct 04, 2015 at 09:44:57AM +0100, Greg KH wrote: > On Sat, Oct 03, 2015 at 02:57:30PM +0530, Chandra S Gorentla wrote: > > - kfree is being called for the members of the queue without > >de-queuing them; they are just inserted within this function; > >they are supposed to be

Re: [PATCH 1/3] drivers: staging: wilc1000: Check for errors before kfree

2015-10-02 Thread Chandra Gorentla
On Fri, Oct 02, 2015 at 04:39:11PM +0300, Dan Carpenter wrote: > On Fri, Oct 02, 2015 at 06:47:35PM +0530, Chandra S Gorentla wrote: > > During the clean-up of the function, it is need to check if > > errors occurred, not the memory pointer. > > > > The bug here is that we have a use after free

Re: [PATCH 1/3] drivers: staging: wilc1000: Check for errors before kfree

2015-10-02 Thread Chandra Gorentla
On Fri, Oct 02, 2015 at 04:39:11PM +0300, Dan Carpenter wrote: > On Fri, Oct 02, 2015 at 06:47:35PM +0530, Chandra S Gorentla wrote: > > During the clean-up of the function, it is need to check if > > errors occurred, not the memory pointer. > > > > The bug here is that we have a use after free

Re: [PATCH 1/2] drivers: staging: wilc1000: Replace message queue with standard Linux lists

2015-09-30 Thread Chandra Gorentla
On Tue, Sep 29, 2015 at 05:31:53AM +0300, Dan Carpenter wrote: > On Mon, Sep 28, 2015 at 11:43:55PM +0530, Chandra S Gorentla wrote: > > - The message queue is replaced with standard Linux linked list > > - kmem_cache is used for list members > > - A check for return value of receive method is

Re: [PATCH 1/2] drivers: staging: wilc1000: Replace message queue with standard Linux lists

2015-09-30 Thread Chandra Gorentla
On Tue, Sep 29, 2015 at 02:44:02AM +0200, Greg KH wrote: > On Mon, Sep 28, 2015 at 11:43:55PM +0530, Chandra S Gorentla wrote: > > - The message queue is replaced with standard Linux linked list > > - kmem_cache is used for list members > > Why? The list entires are of fixed type and repeatedly

Re: [PATCH 1/2] drivers: staging: wilc1000: Replace message queue with standard Linux lists

2015-09-30 Thread Chandra Gorentla
On Tue, Sep 29, 2015 at 02:44:02AM +0200, Greg KH wrote: > On Mon, Sep 28, 2015 at 11:43:55PM +0530, Chandra S Gorentla wrote: > > - The message queue is replaced with standard Linux linked list > > - kmem_cache is used for list members > > Why? The list entires are of fixed type and repeatedly

Re: [PATCH 1/2] drivers: staging: wilc1000: Replace message queue with standard Linux lists

2015-09-30 Thread Chandra Gorentla
On Tue, Sep 29, 2015 at 05:31:53AM +0300, Dan Carpenter wrote: > On Mon, Sep 28, 2015 at 11:43:55PM +0530, Chandra S Gorentla wrote: > > - The message queue is replaced with standard Linux linked list > > - kmem_cache is used for list members > > - A check for return value of receive method is

Re: [PATCH 2/2] drivers: staging: wilc1000: wilc_msgqueue.c: Remove code that no effect

2015-09-28 Thread Chandra Gorentla
Please do not review this. This is duplicate to - [PATCH 2/2] drivers: staging: wilc1000: wilc_msgqueue.c: Remove ineffective code On Mon, Sep 28, 2015 at 11:43:56PM +0530, Chandra S Gorentla wrote: > Signed-off-by: Chandra S Gorentla > --- > drivers/staging/wilc1000/wilc_msgqueue.c | 5 -

Re: [PATCH 2/2] drivers: staging: wilc1000: wilc_msgqueue.c: Remove code that no effect

2015-09-28 Thread Chandra Gorentla
Please do not review this. This is duplicate to - [PATCH 2/2] drivers: staging: wilc1000: wilc_msgqueue.c: Remove ineffective code On Mon, Sep 28, 2015 at 11:43:56PM +0530, Chandra S Gorentla wrote: > Signed-off-by: Chandra S Gorentla > --- >

drivers: staging: wilc1000 - NULL pointer dereference

2015-09-13 Thread Chandra Gorentla
Hi, At this point I do not have the hardware. NULL pointer deference is observed in the wilc1000.ko module on x86 target with bus type SPI and when SPI is not ready. Following are the steps to reproduce. $ sudo insmod drivers/staging/wilc1000/wilc1000.ko $ sudo ifconfig wlan1 up wlan1 in the

drivers: staging: wilc1000 - NULL pointer dereference

2015-09-13 Thread Chandra Gorentla
Hi, At this point I do not have the hardware. NULL pointer deference is observed in the wilc1000.ko module on x86 target with bus type SPI and when SPI is not ready. Following are the steps to reproduce. $ sudo insmod drivers/staging/wilc1000/wilc1000.ko $ sudo ifconfig wlan1 up wlan1 in the

Re: [PATCH] staging: wilc1000: Set all options in region debugfs file

2015-08-19 Thread Chandra Gorentla
On Tue, Aug 18, 2015 at 08:01:00PM -0700, Greg KH wrote: > On Tue, Aug 18, 2015 at 10:32:17PM +0530, Chandra S Gorentla wrote: > > This patch allows setting all options in the module's debug region > > options file 'wilc_debug_region'. This functionality allows the user > > to enable logging from

Re: [PATCH] staging: wilc1000: Set all options in region debugfs file

2015-08-19 Thread Chandra Gorentla
On Tue, Aug 18, 2015 at 08:01:00PM -0700, Greg KH wrote: On Tue, Aug 18, 2015 at 10:32:17PM +0530, Chandra S Gorentla wrote: This patch allows setting all options in the module's debug region options file 'wilc_debug_region'. This functionality allows the user to enable logging from all

Re: [PATCH] staging: wilc100: Remove pointer and integer comparision

2015-08-11 Thread Chandra Gorentla
On Mon, Aug 10, 2015 at 09:38:56PM +0300, Dan Carpenter wrote: > Warnings are not a bad thing they are a valuable marker to let us know > which code is broken. If we just silence the warning in the laziest > possible way then we are throwing away valuable information. It's > better to leave the

Re: [PATCH] staging: wilc100: Remove pointer and integer comparision

2015-08-11 Thread Chandra Gorentla
On Mon, Aug 10, 2015 at 09:38:56PM +0300, Dan Carpenter wrote: Warnings are not a bad thing they are a valuable marker to let us know which code is broken. If we just silence the warning in the laziest possible way then we are throwing away valuable information. It's better to leave the

Re: [PATCH] staging: wilc100: Remove pointer and integer comparision

2015-08-10 Thread Chandra Gorentla
On Mon, Aug 10, 2015 at 07:27:13PM +0300, Dan Carpenter wrote: > On Mon, Aug 10, 2015 at 08:59:43PM +0530, Chandra Gorentla wrote: > > I agree with your suggestion > > that we need to take a broader look. Please help in understanding > > how does that broader look is sugg

Re: [PATCH] staging: wilc100: Remove pointer and integer comparision

2015-08-10 Thread Chandra Gorentla
On Mon, Aug 10, 2015 at 12:39:43PM +0300, Dan Carpenter wrote: > On Sun, Aug 09, 2015 at 08:50:02PM +0530, Chandra S Gorentla wrote: > > Removed pointer check with integer; this fixes 'sparse' error - > > error: incompatible types for operation (>) > >left side has type unsigned char

Re: [PATCH] staging: wilc100: Remove pointer and integer comparision

2015-08-10 Thread Chandra Gorentla
On Mon, Aug 10, 2015 at 12:39:43PM +0300, Dan Carpenter wrote: On Sun, Aug 09, 2015 at 08:50:02PM +0530, Chandra S Gorentla wrote: Removed pointer check with integer; this fixes 'sparse' error - error: incompatible types for operation () left side has type unsigned char [usertype]

Re: [PATCH] staging: wilc100: Remove pointer and integer comparision

2015-08-10 Thread Chandra Gorentla
On Mon, Aug 10, 2015 at 07:27:13PM +0300, Dan Carpenter wrote: On Mon, Aug 10, 2015 at 08:59:43PM +0530, Chandra Gorentla wrote: I agree with your suggestion that we need to take a broader look. Please help in understanding how does that broader look is suggesting that the patch

Re: [PATCH v3 2/3] drivers: staging: wilc1000: move { to previous line

2015-08-06 Thread Chandra Gorentla
On Wed, Aug 05, 2015 at 10:11:56PM +0530, Chandra S Gorentla wrote: > Moved the opening brace of code blocks to the previous lines. This > fixes the checkpatch.pl error - "that open brace { should be on the > previous line". > > Signed-off-by: Chandra S Gorentla > --- >

Re: [PATCH v3 2/3] drivers: staging: wilc1000: move { to previous line

2015-08-06 Thread Chandra Gorentla
On Wed, Aug 05, 2015 at 10:11:56PM +0530, Chandra S Gorentla wrote: Moved the opening brace of code blocks to the previous lines. This fixes the checkpatch.pl error - that open brace { should be on the previous line. Signed-off-by: Chandra S Gorentla csgoren...@gmail.com ---

Re: [PATCH] staging: wilc1000: host_interface.c: Fix build warning

2015-07-29 Thread Chandra Gorentla
On Wed, Jul 29, 2015 at 05:20:37PM +0300, Dan Carpenter wrote: > On Wed, Jul 29, 2015 at 07:36:59PM +0530, Chandra S Gorentla wrote: > > Fixed - warning: ‘*((void *)+4).pu8Head’ may be used > > uninitialized > > > > I can't reproduce this warning and the original code looks fine to me. > >

Re: [PATCH] staging: wilc1000: host_interface.c: Fix build warning

2015-07-29 Thread Chandra Gorentla
On Wed, Jul 29, 2015 at 05:20:37PM +0300, Dan Carpenter wrote: On Wed, Jul 29, 2015 at 07:36:59PM +0530, Chandra S Gorentla wrote: Fixed - warning: ‘*((void *)strHostIFmsg+4).pu8Head’ may be used uninitialized I can't reproduce this warning and the original code looks fine to me.