]> git.baikalelectronics.ru Git - kernel.git/commit
s390/qeth: fix use-after-free in error path
authorJulian Wiedmann <jwi@linux.ibm.com>
Mon, 4 Feb 2019 16:40:07 +0000 (17:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Feb 2019 17:43:48 +0000 (09:43 -0800)
commit536cc01e72c05b9804a5a45b0971d2d9b1239ad2
treeacf775612be44490db75c62b6a229e6279a93774
parent92a63984cefe7dc6bce6f85a4f0bc2028218a427
s390/qeth: fix use-after-free in error path

The error path in qeth_alloc_qdio_buffers() that takes care of
cleaning up the Output Queues is buggy. It first frees the queue, but
then calls qeth_clear_outq_buffers() with that very queue struct.

Make the call to qeth_clear_outq_buffers() part of the free action
(in the correct order), and while at it fix the naming of the helper.

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