Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2007904iob; Thu, 5 May 2022 13:08:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJympzP/OuqNOvK+DXXCk86Brj4CPRT78ClqhuDF47IsOz+lMAQCU4Wp8RDXo6Pl2+iiKvB4 X-Received: by 2002:a17:907:72c2:b0:6f4:ef00:4588 with SMTP id du2-20020a17090772c200b006f4ef004588mr5654236ejc.515.1651781300329; Thu, 05 May 2022 13:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651781300; cv=none; d=google.com; s=arc-20160816; b=aR8vuy8ekoMOT1JVKzGz43b2Ksr4HdVUVexipmhVPaffuNlNs0KdaaMmDkKG5Owo42 XKa/kATjOiz+MtWjSjlB20kdPB26iOedBWRh0FbtJuRV/oynmfOA/XgNZ0J/K4CpWXc1 FF1FTwm/S1jeEXVAGHsyzwmjS6PNPoKcBy5OXx4BDB3u0kmEh2x56cchK5aWNI3ikFdG xKE7O8EYvufoeAVzjmzlHyXA527kJ4+tn3dtdCmkWcx4L+UN+kqQvnKiqBxPOhF8iAS6 nnrRZFLr8aUgDCjw55L3af8SIMfM6qjYC5uT4y8Tkm2cNHkT/XoAOZ+qocKnDxBBRHrh F3Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=o8ooByoOss4uCjNbxVkZKi8NcHkMgbZFCCa8w+PZkR8=; b=m5U04Guvrucr1XR3ezzaVKh3vb/8XZx2NeMPZnBQQuXgBosTFxayQ2xLMezim4Wqo2 Ahxk9RzGyV4JPiaIDSMvIr3QO7wVyt0I9pHaaK0KDEJrCviI3dH6PYauKkpUfJNp0ZzE j8Ksg4Q0/7OLWo0HQnwgvd2jYhXPB8vwCrhkl//SHr0+NwTMOIqSQXffVe9W6/kNj8jR +R07NgwG47f54dLC5gxYyN4MAHZH19Rb2mgzlP/Baj5fgKSJ9x7FUAhJt+ZDKw3hgSo6 1EFX2XK8V6QrCDtVicEmSxMTsvg/Syp7d/njM0DDw9gn/18CErp3ESJynQf/VScxr0It UOWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tLFPcbfL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn21-20020a1709070d1500b006dffbac9704si3754806ejc.747.2022.05.05.13.07.56; Thu, 05 May 2022 13:08:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tLFPcbfL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354582AbiEDRKO (ORCPT + 99 others); Wed, 4 May 2022 13:10:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355641AbiEDRAT (ORCPT ); Wed, 4 May 2022 13:00:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5E644BB96; Wed, 4 May 2022 09:51:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A228D617A6; Wed, 4 May 2022 16:51:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2F17C385A4; Wed, 4 May 2022 16:51:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683118; bh=bk8oiHo7fAjLCDCB+GgK+zQPJnwtXBeitJ/3OLXIcW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tLFPcbfLakokdhPhOs2vV855XKojdSES34R3eUiYJf6DGsUeaVprX4uHutIntmmCf oXc2vMrTy4vsDxFd3OMkf+TJW8HTFEc5PMyF2mh0Zn7e7js95bz1K19MfQPenazrCi rquMDkZ0QATMjx8AW+B0JvjUm5rXzsHBrlSxntao= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Starke Subject: [PATCH 5.10 122/129] tty: n_gsm: fix wrong DLCI release order Date: Wed, 4 May 2022 18:45:14 +0200 Message-Id: <20220504153031.140574826@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153021.299025455@linuxfoundation.org> References: <20220504153021.299025455@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Starke commit deefc58bafb4841df7f0a0d85d89a1c819db9743 upstream. The current DLCI release order starts with the control channel followed by the user channels. Reverse this order to keep the control channel open until all user channels have been released. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-9-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/n_gsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2073,8 +2073,8 @@ static void gsm_cleanup_mux(struct gsm_m /* Finish outstanding timers, making sure they are done */ del_timer_sync(&gsm->t2_timer); - /* Free up any link layer users */ - for (i = 0; i < NUM_DLCI; i++) + /* Free up any link layer users and finally the control channel */ + for (i = NUM_DLCI - 1; i >= 0; i--) if (gsm->dlci[i]) gsm_dlci_release(gsm->dlci[i]); mutex_unlock(&gsm->mutex);