2003-11-28 02:23:33

by Tonnerre Anklin

[permalink] [raw]
Subject: [I4L] Unbind slot on failure in ST_SLOT_BOUND

Salut,

If a dialup attempt fails (e.g. HiSax doesn't define
ISDN_CMD_CLREAZ and thus returns -EINVAL), the slot stays in
ST_SLOT_BOUND. That doesn't seem to be a great idea, because
any disconnect or further connect attempts will fail. This
also causes the kernel to hang on shutdown after a failed
dial attempt.

More on this patch can be found at
<URL:http://keepsake.keepsake.ch/~thunder/noyau/2.6.0-test11-ta1/isdn_slot_unbind.xml>

Thunder

diff -Nur linux-2.6.0-test9-mm3/drivers/isdn/i4l/isdn_common.c linux-2.6.0-test9-mm3-ta1/drivers/isdn/i4l/isdn_common.c
--- linux-2.6.0-test9-mm3/drivers/isdn/i4l/isdn_common.c 2003-10-08 21:24:04.000000000 +0200
+++ linux-2.6.0-test9-mm3-ta1/drivers/isdn/i4l/isdn_common.c 2003-11-24 13:35:38.000000000 +0100
@@ -2105,7 +2105,7 @@

retval = isdn_slot_command(slot, ISDN_CMD_CLREAZ, &cmd);
if (retval)
- return retval;
+ goto out_unbind;

strcpy(cmd.parm.num, msn);
retval = isdn_slot_command(slot, ISDN_CMD_SETEAZ, &cmd);
@@ -2114,12 +2114,12 @@
cmd.parm.fax = dial->fax;
retval = isdn_slot_command(slot, ISDN_CMD_SETL2, &cmd);
if (retval)
- return retval;
+ goto out_unbind;

cmd.arg = dial->l3_proto << 8;
retval = isdn_slot_command(slot, ISDN_CMD_SETL3, &cmd);
if (retval)
- return retval;
+ goto out_unbind;

cmd.parm.setup.si1 = dial->si1;
cmd.parm.setup.si2 = dial->si2;
@@ -2132,6 +2132,9 @@
dial->l2_proto, dial->l3_proto);

return isdn_slot_command(slot, ISDN_CMD_DIAL, &cmd);
+ out_unbind:
+ fsm_event(&slot->fi, EV_SLOT_UNBIND, NULL);
+ return retval;
}

int


Attachments:
(No filename) (1.53 kB)
signature.asc (189.00 B)
Digital signature
Download all attachments