]> git.baikalelectronics.ru Git - kernel.git/commit
s390/qeth: fix memory leak after failed TX Buffer allocation
authorJulian Wiedmann <jwi@linux.ibm.com>
Tue, 9 Mar 2021 16:52:18 +0000 (17:52 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Mar 2021 00:14:53 +0000 (16:14 -0800)
commit8c0b0922ecbbac59a5a29d13cb7a5351e12d07b6
treef683d7bff3e97ef1e83168390f80c9bf92b3647f
parentfc7aa424920240914091d569ffa87b5a60cb5951
s390/qeth: fix memory leak after failed TX Buffer allocation

When qeth_alloc_qdio_queues() fails to allocate one of the buffers that
back an Output Queue, the 'out_freeoutqbufs' path will free all
previously allocated buffers for this queue. But it misses to free the
half-finished queue struct itself.

Move the buffer allocation into qeth_alloc_output_queue(), and deal with
such errors internally.

Fixes: 83e8926a5353 ("qeth: exploit asynchronous delivery of storage blocks")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core_main.c