Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2058272pxb; Fri, 5 Mar 2021 06:30:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8RFo9ihCHjP+5dlmZYoAHA3DykDkjP2yUgGy23I0wGsPALpKE4civt6+DRKN23gCeLQRn X-Received: by 2002:a17:906:c402:: with SMTP id u2mr2429758ejz.546.1614954649706; Fri, 05 Mar 2021 06:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614954649; cv=none; d=google.com; s=arc-20160816; b=crHXqVjfisNmuRtUq/J9eA703rCQtPHH3r/0YHvYghTg11X75hOkf6Q3hms6TqdWa7 iT6FEcTqZncc3oKPxwJq/0LIFHrkMcyE+OVQ6/k/3gKVZqZK+8+yuc/cR6QIdPKRZRq/ cO+Z/1+Tv21n9LFC2btmfsQzkd7pKq04hzP5Mx+jd6yyM3ygreLAone4joCavsQOiw3B fh2o8kRy6/qJ9GtGFMfIALvEmRNDZpEfihgS4nRZa/HYNccgAtgPhfPezBuKhKu7/BsV lwKKJVfbzCc41qViH+2MosN/QCFTbSt5xdhBOEmEhFCPIwPqRbRT1qOzONET0gfIuya2 iLVg== 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 :message-id:date:subject:cc:to:from; bh=5eGMjW0/0FS8wcIYA9qrwriQ7+t9gtpkbJxLpQkObag=; b=kJ+2t0X97MdBT9T1pOmlGb8osnS6VhD5cIHwfHGWwnTCrTNF1/oK3eXop3O6GNwfqc t33WNgFjDq89YovTADOE1MO+oBh+7K3vzuqv4SXLAuXvMf40hIrnrYvkhx9fmwZx2qJD u/Iy6iZ2bZC8CBdgmq9spzAp/R3w6wFHYURasX9Gj2+VkLky3EPpuyG23ZUDwJOO5YcU gTJycY/PPJX8mtH6+b1Hqp5ic4IpfBhmFUuXEv3+CLA5S9hqqSJ8cn5HDxw/4J5EzMJD aKJt6J7Nu/uOVIB/yiSrcHb88BRCCYHG/4Ff3MDIhXY2Y00VDrFeVDuG7R/4XLqlzMca VYaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q16si1522914edr.239.2021.03.05.06.30.26; Fri, 05 Mar 2021 06:30:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230499AbhCEO3X (ORCPT + 99 others); Fri, 5 Mar 2021 09:29:23 -0500 Received: from mail-lf1-f54.google.com ([209.85.167.54]:46706 "EHLO mail-lf1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229723AbhCEO3I (ORCPT ); Fri, 5 Mar 2021 09:29:08 -0500 Received: by mail-lf1-f54.google.com with SMTP id v5so3867749lft.13; Fri, 05 Mar 2021 06:29:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5eGMjW0/0FS8wcIYA9qrwriQ7+t9gtpkbJxLpQkObag=; b=YAdqN4T6q1MOyCXJfFgu0+MJoIveiMOFyg3NorUXJn51wMHoUjh2NecXuJtqwYgUfQ g5GRHDVM3LtwcVZsY3vlBlMZlmIhFCL2A6QUrix6upKqSENi7elSpD8nO0Pq3FqFcpgG 9qKPSMTB5bs3lquEZnjq65CCFfKqnTXsuBvoA1c7F7Q6Tx//MzQGEwFx+hkSnwcaHL7Z W0fDUdX8KF21sL9Zd1boenUfX/aGHkwmaAl4ApKZ3pHStFSiUoVd6aGBklrHA0NRPq1i LOo/Ul1xR+76qYK+f78ZV4u4P3Sh2jJO0ODrSXwix3xMUuzMkfwioNaINXxTHkAy6dze Ir2A== X-Gm-Message-State: AOAM530q5mcV7suYLuJh4m0M1Vsww8bJ8d5vOUNvOHtq6K9wTt1ymxMO 67cUmE2KdtM1W+IQ7KOia1w= X-Received: by 2002:a05:6512:4c6:: with SMTP id w6mr5787673lfq.258.1614954546496; Fri, 05 Mar 2021 06:29:06 -0800 (PST) Received: from localhost.. (broadband-188-32-236-56.ip.moscow.rt.ru. [188.32.236.56]) by smtp.googlemail.com with ESMTPSA id d4sm331040lfs.45.2021.03.05.06.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 06:29:05 -0800 (PST) From: Denis Efremov To: Andreas Koensgen Cc: Denis Efremov , "David S. Miller" , Jakub Kicinski , linux-hams@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net/hamradio/6pack: remove redundant check in sp_encaps() Date: Fri, 5 Mar 2021 19:26:22 +0300 Message-Id: <20210305162622.67993-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "len > sp->mtu" checked twice in a row in sp_encaps(). Remove the second check. Signed-off-by: Denis Efremov --- drivers/net/hamradio/6pack.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 71d6629e65c9..9f5b5614a150 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c @@ -171,11 +171,6 @@ static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len) goto out_drop; } - if (len > sp->mtu) { /* sp->mtu = AX25_MTU = max. PACLEN = 256 */ - msg = "oversized transmit packet!"; - goto out_drop; - } - if (p[0] > 5) { msg = "invalid KISS command"; goto out_drop; -- 2.26.2