gigaset: correct clearing of at_state strings on RING
authorTilman Schmidt <tilman@imap.cc>
Sun, 14 Mar 2010 12:58:05 +0000 (12:58 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:58:23 +0000 (15:58 -0700)
commit 3a0a3a6b92edf181f849ebd8417122392ba73a96 upstream.

In RING handling, clear the table of received parameter strings in
a loop like everywhere else, instead of by enumeration which had
already gotten out of sync.

Impact: minor bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Acked-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/isdn/gigaset/ev-layer.c

index cc768caa38f54b86f48ec92310ed93e3b1fcf998..a0f7b99aee8be4b8d3aab15c03f7af6ecfb5005e 100644 (file)
@@ -1243,14 +1243,10 @@ static void do_action(int action, struct cardstate *cs,
                 * note that bcs may be NULL if no B channel is free
                 */
                at_state2->ConState = 700;
-               kfree(at_state2->str_var[STR_NMBR]);
-               at_state2->str_var[STR_NMBR] = NULL;
-               kfree(at_state2->str_var[STR_ZCPN]);
-               at_state2->str_var[STR_ZCPN] = NULL;
-               kfree(at_state2->str_var[STR_ZBC]);
-               at_state2->str_var[STR_ZBC] = NULL;
-               kfree(at_state2->str_var[STR_ZHLC]);
-               at_state2->str_var[STR_ZHLC] = NULL;
+               for (i = 0; i < STR_NUM; ++i) {
+                       kfree(at_state2->str_var[i]);
+                       at_state2->str_var[i] = NULL;
+               }
                at_state2->int_var[VAR_ZCTP] = -1;
 
                spin_lock_irqsave(&cs->lock, flags);