Re: virtio_blk: Less function calls in init_vq() after error detection

2016-09-14 Thread Cornelia Huck
On Tue, 13 Sep 2016 20:24:58 +0200 Christian Borntraeger wrote: > See, some of your patches are accepted, e.g. the memdup_user changes have > usually > been applied by most maintainers including myself. If maintainers won't take > other change, > please accept that. If you continue to waste peo

Re: virtio_blk: Less function calls in init_vq() after error detection

2016-09-13 Thread SF Markus Elfring
>>How much will it matter in general that two function calls are performed >>in this use case without checking their return values immediately? >>https://cwe.mitre.org/data/definitions/252.html >> >> if (!names || !callbacks || !vqs) { … >> >>https://cwe.mitre.org/data/definiti

Re: virtio_blk: Less function calls in init_vq() after error detection

2016-09-13 Thread Christian Borntraeger
On 09/13/2016 07:30 PM, SF Markus Elfring wrote: [...] > Unfortunately, I get an other impression here after a closer look. > > Can it be that the discussed commit from 2016-08-09 accepted (or tolerated) > two weaknesses at least? > > 1. Commit title: >Is the word "slient" a typo? >Would

Re: virtio_blk: Less function calls in init_vq() after error detection

2016-09-13 Thread SF Markus Elfring
> In addition, please have a look at commit > 347a529398e8e723338cca5d8a8ae2d9e7e93448 > virtio_blk: Fix a slient kernel panic I would like to add another view on the implementation details in this software update. > which did the opposite of your patch. This update contained a different

Re: virtio_blk: Less function calls in init_vq() after error detection

2016-09-13 Thread SF Markus Elfring
>> drivers/block/virtio_blk.c | 22 +- >> 1 file changed, 17 insertions(+), 5 deletions(-) > > Can't you see from this diffstat that the patch actually seems to makes > the code more complex? I find that the repeated usage of a bit more error handling code is almost unavoidab

Re: [PATCH 2/4] virtio_blk: Less function calls in init_vq() after error detection

2016-09-13 Thread Christian Borntraeger
On 09/13/2016 02:13 PM, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 13 Sep 2016 13:20:44 +0200 > > The kfree() function was called in up to three cases > by the init_vq() function during error handling even if > the passed variable contained a null pointer. > > * Split a conditi

[PATCH 2/4] virtio_blk: Less function calls in init_vq() after error detection

2016-09-13 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 13 Sep 2016 13:20:44 +0200 The kfree() function was called in up to three cases by the init_vq() function during error handling even if the passed variable contained a null pointer. * Split a condition check for memory allocation failures. * Adjust jump targets a