Commit c79b01b8 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Greg Kroah-Hartman

s390/qdio: don't release memory in qdio_setup_irq()

commit 2e68adcd upstream.

Calling qdio_release_memory() on error is just plain wrong. It frees
the main qdio_irq struct, when following code still uses it.

Also, no other error path in qdio_establish() does this. So trust
callers to clean up via qdio_free() if some step of the QDIO
initialization fails.

Fixes: 779e6e1c ("[S390] qdio: new qdio driver.")
Cc: <stable@vger.kernel.org> #v2.6.27+
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a03e14f0
...@@ -456,7 +456,6 @@ int qdio_setup_irq(struct qdio_initialize *init_data) ...@@ -456,7 +456,6 @@ int qdio_setup_irq(struct qdio_initialize *init_data)
{ {
struct ciw *ciw; struct ciw *ciw;
struct qdio_irq *irq_ptr = init_data->cdev->private->qdio_data; struct qdio_irq *irq_ptr = init_data->cdev->private->qdio_data;
int rc;
memset(&irq_ptr->qib, 0, sizeof(irq_ptr->qib)); memset(&irq_ptr->qib, 0, sizeof(irq_ptr->qib));
memset(&irq_ptr->siga_flag, 0, sizeof(irq_ptr->siga_flag)); memset(&irq_ptr->siga_flag, 0, sizeof(irq_ptr->siga_flag));
...@@ -493,16 +492,14 @@ int qdio_setup_irq(struct qdio_initialize *init_data) ...@@ -493,16 +492,14 @@ int qdio_setup_irq(struct qdio_initialize *init_data)
ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_EQUEUE); ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_EQUEUE);
if (!ciw) { if (!ciw) {
DBF_ERROR("%4x NO EQ", irq_ptr->schid.sch_no); DBF_ERROR("%4x NO EQ", irq_ptr->schid.sch_no);
rc = -EINVAL; return -EINVAL;
goto out_err;
} }
irq_ptr->equeue = *ciw; irq_ptr->equeue = *ciw;
ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_AQUEUE); ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_AQUEUE);
if (!ciw) { if (!ciw) {
DBF_ERROR("%4x NO AQ", irq_ptr->schid.sch_no); DBF_ERROR("%4x NO AQ", irq_ptr->schid.sch_no);
rc = -EINVAL; return -EINVAL;
goto out_err;
} }
irq_ptr->aqueue = *ciw; irq_ptr->aqueue = *ciw;
...@@ -510,9 +507,6 @@ int qdio_setup_irq(struct qdio_initialize *init_data) ...@@ -510,9 +507,6 @@ int qdio_setup_irq(struct qdio_initialize *init_data)
irq_ptr->orig_handler = init_data->cdev->handler; irq_ptr->orig_handler = init_data->cdev->handler;
init_data->cdev->handler = qdio_int_handler; init_data->cdev->handler = qdio_int_handler;
return 0; return 0;
out_err:
qdio_release_memory(irq_ptr);
return rc;
} }
void qdio_print_subchannel_info(struct qdio_irq *irq_ptr, void qdio_print_subchannel_info(struct qdio_irq *irq_ptr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment