Re: [PATCH 5/6] staging: dgap: tty.c: removes smatch warnings potential null dereference

2013-09-25 Thread Lidza Louina
On Tue, Sep 24, 2013 at 3:20 PM, Dan Carpenter dan.carpen...@oracle.com wrote: On Tue, Sep 24, 2013 at 02:40:10PM -0400, Lidza Louina wrote: Instead of writing: brd-SerialDriver = alloc_tty_driver(MAXPORTS); if (!brd-SerialDriver){ goto free_stuff;

Re: [PATCH 5/6] staging: dgap: tty.c: removes smatch warnings potential null dereference

2013-09-25 Thread Dan Carpenter
On Wed, Sep 25, 2013 at 01:22:08PM -0400, Lidza Louina wrote: I looked at other uses of the function alloc_tty_driver() in the kernel and none of them seem to follow up with a call to kfree(). Read my first response again. I showed how to do this. Your setting up a bunch of things in a

Re: [PATCH 5/6] staging: dgap: tty.c: removes smatch warnings potential null dereference

2013-09-25 Thread Lidza Louina
On Wed, Sep 25, 2013 at 2:34 PM, Dan Carpenter dan.carpen...@oracle.com wrote: On Wed, Sep 25, 2013 at 01:22:08PM -0400, Lidza Louina wrote: I looked at other uses of the function alloc_tty_driver() in the kernel and none of them seem to follow up with a call to kfree(). Read my first

Re: [PATCH 5/6] staging: dgap: tty.c: removes smatch warnings potential null dereference

2013-09-25 Thread Dan Carpenter
On Wed, Sep 25, 2013 at 06:13:47PM -0400, Lidza Louina wrote: On Wed, Sep 25, 2013 at 2:34 PM, Dan Carpenter dan.carpen...@oracle.com wrote: On Wed, Sep 25, 2013 at 01:22:08PM -0400, Lidza Louina wrote: I looked at other uses of the function alloc_tty_driver() in the kernel and none of

Re: [PATCH 5/6] staging: dgap: tty.c: removes smatch warnings potential null dereference

2013-09-25 Thread Lidza Louina
On Wed, Sep 25, 2013 at 6:29 PM, Dan Carpenter dan.carpen...@oracle.com wrote: On Wed, Sep 25, 2013 at 06:13:47PM -0400, Lidza Louina wrote: On Wed, Sep 25, 2013 at 2:34 PM, Dan Carpenter dan.carpen...@oracle.com wrote: On Wed, Sep 25, 2013 at 01:22:08PM -0400, Lidza Louina wrote: I

Re: [PATCH 5/6] staging: dgap: tty.c: removes smatch warnings potential null dereference

2013-09-24 Thread Lidza Louina
On Mon, Sep 23, 2013 at 8:27 PM, Dan Carpenter dan.carpen...@oracle.com wrote: On Mon, Sep 23, 2013 at 06:47:16PM -0400, Lidza Louina wrote: This patch removes these warnings: potential null dereference 'brd-SerialDriver'. (alloc_tty_driver returns null) potential null dereference

Re: [PATCH 5/6] staging: dgap: tty.c: removes smatch warnings potential null dereference

2013-09-24 Thread Dan Carpenter
On Tue, Sep 24, 2013 at 02:40:10PM -0400, Lidza Louina wrote: Instead of writing: brd-SerialDriver = alloc_tty_driver(MAXPORTS); if (!brd-SerialDriver){ goto free_stuff; return -ENOMEM; } Would it correct if I wrote:

[PATCH 5/6] staging: dgap: tty.c: removes smatch warnings potential null dereference

2013-09-23 Thread Lidza Louina
This patch removes these warnings: potential null dereference 'brd-SerialDriver'. (alloc_tty_driver returns null) potential null dereference 'brd-PrintDriver'. (alloc_tty_driver returns null) This warning popped up because there wasn't a check to make sure that the serial and print drivers were

Re: [PATCH 5/6] staging: dgap: tty.c: removes smatch warnings potential null dereference

2013-09-23 Thread Dan Carpenter
On Mon, Sep 23, 2013 at 06:47:16PM -0400, Lidza Louina wrote: This patch removes these warnings: potential null dereference 'brd-SerialDriver'. (alloc_tty_driver returns null) potential null dereference 'brd-PrintDriver'. (alloc_tty_driver returns null) This warning popped up because there