Commit 5065b2dd authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: release cmd buffer in error paths

Whenever we fail before/while starting an IO, make sure to release the
IO buffer. Usually qeth_irq() would do this for us, but if the IO
doesn't even start we obviously won't get an interrupt for it either.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c1f7e029
...@@ -566,6 +566,7 @@ static int __qeth_issue_next_read(struct qeth_card *card) ...@@ -566,6 +566,7 @@ static int __qeth_issue_next_read(struct qeth_card *card)
QETH_DBF_MESSAGE(2, "error %i on device %x when starting next read ccw!\n", QETH_DBF_MESSAGE(2, "error %i on device %x when starting next read ccw!\n",
rc, CARD_DEVID(card)); rc, CARD_DEVID(card));
atomic_set(&channel->irq_pending, 0); atomic_set(&channel->irq_pending, 0);
qeth_release_buffer(channel, iob);
card->read_or_write_problem = 1; card->read_or_write_problem = 1;
qeth_schedule_recovery(card); qeth_schedule_recovery(card);
wake_up(&card->wait_q); wake_up(&card->wait_q);
...@@ -1127,6 +1128,8 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, ...@@ -1127,6 +1128,8 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm,
rc = qeth_get_problem(card, cdev, irb); rc = qeth_get_problem(card, cdev, irb);
if (rc) { if (rc) {
card->read_or_write_problem = 1; card->read_or_write_problem = 1;
if (iob)
qeth_release_buffer(iob->channel, iob);
qeth_clear_ipacmd_list(card); qeth_clear_ipacmd_list(card);
qeth_schedule_recovery(card); qeth_schedule_recovery(card);
goto out; goto out;
...@@ -1809,6 +1812,7 @@ static int qeth_idx_activate_get_answer(struct qeth_card *card, ...@@ -1809,6 +1812,7 @@ static int qeth_idx_activate_get_answer(struct qeth_card *card,
QETH_DBF_MESSAGE(2, "Error2 in activating channel rc=%d\n", rc); QETH_DBF_MESSAGE(2, "Error2 in activating channel rc=%d\n", rc);
QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
atomic_set(&channel->irq_pending, 0); atomic_set(&channel->irq_pending, 0);
qeth_release_buffer(channel, iob);
wake_up(&card->wait_q); wake_up(&card->wait_q);
return rc; return rc;
} }
...@@ -1878,6 +1882,7 @@ static int qeth_idx_activate_channel(struct qeth_card *card, ...@@ -1878,6 +1882,7 @@ static int qeth_idx_activate_channel(struct qeth_card *card,
rc); rc);
QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc); QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
atomic_set(&channel->irq_pending, 0); atomic_set(&channel->irq_pending, 0);
qeth_release_buffer(channel, iob);
wake_up(&card->wait_q); wake_up(&card->wait_q);
return rc; return rc;
} }
...@@ -2058,6 +2063,7 @@ int qeth_send_control_data(struct qeth_card *card, int len, ...@@ -2058,6 +2063,7 @@ int qeth_send_control_data(struct qeth_card *card, int len,
} }
reply = qeth_alloc_reply(card); reply = qeth_alloc_reply(card);
if (!reply) { if (!reply) {
qeth_release_buffer(channel, iob);
return -ENOMEM; return -ENOMEM;
} }
reply->callback = reply_cb; reply->callback = reply_cb;
......
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