Message ID | 20230405054730.3850-6-daniel.starke@siemens.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp84522vqo; Tue, 4 Apr 2023 23:07:27 -0700 (PDT) X-Google-Smtp-Source: AKy350YOdUyhJELZzmph9PerFDO665YmMZLRaNfCR14DMbC6q2ZvNxW46Q8qbuS5WegPSd9J5m9Z X-Received: by 2002:a05:6a20:3148:b0:d9:e45d:95cd with SMTP id 8-20020a056a20314800b000d9e45d95cdmr3892103pzk.17.1680674847047; Tue, 04 Apr 2023 23:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680674847; cv=none; d=google.com; s=arc-20160816; b=hFpMjzhr+TB149K1q4IZ5YMPBcGHsLUPUVeEn2+lHAucQa74ANQEcjkWkLrjG2qeR4 V2B2TjZnVTicZolql8AQ+mZCWK5VZXWhvk3UvFmeFT9PKFmvrdPZU6ZhEzUgVELYnJel apNUKbfuEYmyPIiQ8pq2yGNlyzJw7wK94jzDU/R5VtPItCaeTE3y8dCxDvy1jthCTXSP 9fMQtEcKVBOs/pHDogcoos8o1x8sof3hF9o2cGo5l0cGOmejnBQwfoRFu/XoB6jvHw0w 1/gJtxw1r8aK+kMWB6hJzigjABYwX4creNUwzlzmbwG8m7sI0nV3naJ/v+SgagN47tM8 LxgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uJwl9+ZDqP0Gge7uLTPceewqkWgzi1mhsOlMd09/Rek=; b=Y3PpfEb4VHwvAb1Hdt1771HAr5hM3MXUBrILtD8kWUry8tAn04tyDKx8tsyXaBxFAO xSpirkQ/HnfZSSPSVgkPPvoxmQ6Q51l3DMrk7b7J2dQE4D7f0DDzDtf8m2IZyjJhhmsj VrJEf1qckFiaoPN+2IPCBz2HRvFth3n0/uYqp/TBlI5SgivrHkam7b0zLb3Zzzq4aN9N y0oFyY6xbgIAN3jngSyk/N/8ASPrsyfBaiuOjVmJJ0RZpOEhudx7/wR04X0DjMc1tb9y ffbwQ+4rfGYHL6/nC3iX+Bop+2YCudOxKmhVAHdZZRwIWMKHEyBQAtZ5db20e/qJfMAr DQeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=JXWjQW5q; 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=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020a63b303000000b004fbc70b72cesi5910000pgf.771.2023.04.04.23.07.13; Tue, 04 Apr 2023 23:07:27 -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=@siemens.com header.s=fm1 header.b=JXWjQW5q; 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=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236967AbjDEFtF (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Wed, 5 Apr 2023 01:49:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236914AbjDEFsp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Apr 2023 01:48:45 -0400 Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net [185.136.64.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A5FA4209 for <linux-kernel@vger.kernel.org>; Tue, 4 Apr 2023 22:48:44 -0700 (PDT) Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 202304050548413b6f5576ae346ac24b for <linux-kernel@vger.kernel.org>; Wed, 05 Apr 2023 07:48:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=daniel.starke@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=uJwl9+ZDqP0Gge7uLTPceewqkWgzi1mhsOlMd09/Rek=; b=JXWjQW5q8OoaEBEhqWxkx7OVJ7Uguem4duDJb8hts9xh1cc6h93WGQ4UqYil6K0aCTayT9 3BFKIU+j93dhtYG+VlHMyb5eDS40h/C7D5GAponp1aBSXlrD1jPDD6zCYEA7wxY30bVlvDM4 1p5h2cWc+zQQnWHH8DjbO+/kLC+I4=; From: "D. Starke" <daniel.starke@siemens.com> To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com Cc: linux-kernel@vger.kernel.org, Daniel Starke <daniel.starke@siemens.com> Subject: [PATCH 6/9] tty: n_gsm: increase malformed counter for malformed control frames Date: Wed, 5 Apr 2023 07:47:27 +0200 Message-Id: <20230405054730.3850-6-daniel.starke@siemens.com> In-Reply-To: <20230405054730.3850-1-daniel.starke@siemens.com> References: <20230405054730.3850-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-314044:519-21489:flowmailer X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762315308445797410?= X-GMAIL-MSGID: =?utf-8?q?1762315308445797410?= |
Series |
[1/9] tty: n_gsm: fix redundant assignment of gsm->encoding
|
|
Commit Message
D. Starke
April 5, 2023, 5:47 a.m. UTC
From: Daniel Starke <daniel.starke@siemens.com> The malformed counter in gsm_mux is already increased in case of errors detected in gsm_queue() and gsm1_receive(). gsm_dlci_command() also detects a case for a malformed frame but does not increase the malformed counter yet. Fix this by also increasing the gsm_mux malformed counter in case of a malformed frame in gsm_dlci_command(). Signed-off-by: Daniel Starke <daniel.starke@siemens.com> --- drivers/tty/n_gsm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Comments
On Wed, 5 Apr 2023, D. Starke wrote: > From: Daniel Starke <daniel.starke@siemens.com> > > The malformed counter in gsm_mux is already increased in case of errors > detected in gsm_queue() and gsm1_receive(). gsm_dlci_command() also > detects a case for a malformed frame but does not increase the malformed > counter yet. > > Fix this by also increasing the gsm_mux malformed counter in case of a > malformed frame in gsm_dlci_command(). > > Signed-off-by: Daniel Starke <daniel.starke@siemens.com> > --- > drivers/tty/n_gsm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c > index 9f6669686c59..317aa67ed169 100644 > --- a/drivers/tty/n_gsm.c > +++ b/drivers/tty/n_gsm.c > @@ -2454,8 +2454,10 @@ static void gsm_dlci_command(struct gsm_dlci *dlci, const u8 *data, int len) > data += dlen; > > /* Malformed command? */ > - if (clen > len) > + if (clen > len) { > + dlci->gsm->malformed++; > return; > + } Should this change have a Fixes: tag? Or is ->malformed just an internal variable which is not exposed anywhere (in which case state that in the changelog)?
> > + dlci->gsm->malformed++; > > return; > > + } > > Should this change have a Fixes: tag? Or is ->malformed just an internal > variable which is not exposed anywhere (in which case state that in the > changelog)? Correct, the variable is not yet exposed anywhere. I will add a remark for this in the changelog. Best regards, Daniel Starke
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 9f6669686c59..317aa67ed169 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -2454,8 +2454,10 @@ static void gsm_dlci_command(struct gsm_dlci *dlci, const u8 *data, int len) data += dlen; /* Malformed command? */ - if (clen > len) + if (clen > len) { + dlci->gsm->malformed++; return; + } if (command & 1) gsm_control_message(dlci->gsm, command, data, clen);