Re: [PATCH v3] staging: dgnc: check if kzalloc fails in dgnc_tty_init()

2015-04-07 Thread Sudip Mukherjee
On Tue, Apr 07, 2015 at 05:11:15PM +0300, Giedrius Statkevičius wrote: If one of the allocations of memory for storing a channel information struct fails then free all the successful allocations and return -ENOMEM that gets propogated to the pci layer. Also, remove a bogus skipping in the next

Re: [PATCH v3] staging: dgnc: check if kzalloc fails in dgnc_tty_init()

2015-04-07 Thread Giedrius Statkevičius
On Tue, 7 Apr 2015, Sudip Mukherjee wrote: On Tue, Apr 07, 2015 at 05:11:15PM +0300, Giedrius Statkevičius wrote: If one of the allocations of memory for storing a channel information struct fails then free all the successful allocations and return -ENOMEM that gets propogated to the pci

Re: [PATCH v3] staging: dgnc: check if kzalloc fails in dgnc_tty_init()

2015-04-07 Thread Dan Carpenter
If you send a patch series then it's ok that later patches depend on the earlier patches. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH v3] staging: dgnc: check if kzalloc fails in dgnc_tty_init()

2015-04-07 Thread Giedrius Statkevičius
If one of the allocations of memory for storing a channel information struct fails then free all the successful allocations and return -ENOMEM that gets propogated to the pci layer. Also, remove a bogus skipping in the next part of the initiation if a previous memory allocation failed because we

Re: [PATCH v3] staging: dgnc: check if kzalloc fails in dgnc_tty_init()

2015-04-07 Thread Dan Carpenter
You will need to update the subject to reflect the new patch. The original code did check for kzalloc() failure but it had lots of checks scattered around instead nicely at the point where the memory was allocated. The old code and the new code are both buggy though and will crash in

Re: [PATCH v3] staging: dgnc: check if kzalloc fails in dgnc_tty_init()

2015-04-07 Thread Dan Carpenter
On Tue, Apr 07, 2015 at 06:35:51PM +0300, Giedrius Statkevičius wrote: Well, the point of the patch is to put alloc and checks in one place to make the code less error and bug prone and fix some of bugs where -channels[i] isn't checked. Fine, fine. I can accept that. One patch is also ok.

Re: [PATCH v3] staging: dgnc: check if kzalloc fails in dgnc_tty_init()

2015-04-07 Thread Giedrius Statkevičius
On Tue, 7 Apr 2015, Dan Carpenter wrote: You will need to update the subject to reflect the new patch. The original code did check for kzalloc() failure but it had lots of checks scattered around instead nicely at the point where the memory was allocated. There are a lot missing too. For