Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4450077imw; Tue, 19 Jul 2022 06:53:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vD6I0olnZvffg0W3iB1fiRLCy0XbEi8GWNPL5ANTxn9GXGlOuqPvzvr2TfXUdxmjEOSYzY X-Received: by 2002:a17:907:96a2:b0:72e:e155:1331 with SMTP id hd34-20020a17090796a200b0072ee1551331mr24755474ejc.478.1658238802017; Tue, 19 Jul 2022 06:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658238802; cv=none; d=google.com; s=arc-20160816; b=hf7D8OiTBbmNLOR+p8UZPNajLkOZjNaF8Y+IJlORDxqKScw731s79V1PlIDjLxkDYi vX/y40lg49zKF3kpWbE9LrGNl4O8vR1QaSqLRtKDsFT41RfrjdnH3HS3eVOZAevvty5B pBA5ziWcNxJJA5GGdTyOjSDOghAm748vNupL1iXBou5so+6fbSljV6HScH91k6OaNGiq SVi1Dr9riSMJEy70X1l/wsRN3x4NQOkTF7hSCbWDBrZ+PlyjZgJyPAo8V337G/1s118a zAGcH76M9mBQa+1mkogY3hnxx+pbaZCiBzCBn5j+DOwYEw8NveIh6C2cIZFkaRN4c65f 3Idg== 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=k+LHCHl2NMhtw4ulnYgtQ24I1gSSAvuWdMP8Z0bQz4o=; b=JcsaOWpRLGUzjAzKdCOQrJiorTG3Jx1YIcrzx69LdmM5LYgWZRYHEElx5mfwSNcQia eKLNkDoZeD87qkBTOLB9p0AlUXqLeqfkN4qaCPV1RbRxlLLrILCqsLdWk2nxXHKo76Ow ML7fFrWIq0Q6EiJgrMxcx5f9MZThCMqhdnkxqJwoFAXxiQS7uPYwAxuinejIpn8gi94r ZIoyYn/62Nia4o9fjkrk5RsTZokNSom/ZVZeJNEgDgjYMBqC3wBSuAPEZDd/vtfYsmMG Qjf4c0StZjkYfyWX/gU/MY1UE8NGqrec3CLkchTvXOZhbT3IVV2La21ExEMT+LcQRWZ5 Uspg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GJ9K5mSA; 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 dr21-20020a170907721500b0072f25c0af5dsi10487132ejc.135.2022.07.19.06.52.57; Tue, 19 Jul 2022 06:53:22 -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=GJ9K5mSA; 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 S241449AbiGSMmK (ORCPT + 99 others); Tue, 19 Jul 2022 08:42:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241559AbiGSMjw (ORCPT ); Tue, 19 Jul 2022 08:39:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E4567CB6C; Tue, 19 Jul 2022 05:16:09 -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 ams.source.kernel.org (Postfix) with ESMTPS id 0B368B81B2E; Tue, 19 Jul 2022 12:16:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 528FAC341C6; Tue, 19 Jul 2022 12:16:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232964; bh=h4G0ZMwejUgQBnTsSAswijUdua2pXdP0jPXgjlc/ETc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GJ9K5mSAENPwUAG6b7GvyrCZM6N1WqOi4puwZLmX91DajeJLjrDRmKAUK2orNloWG sAFRY7hiJ31IYGHslSMZmB9JdK1ZhDoMZ9eHiFNv9dmSUxCwqErZEQMzE/S1ZbQqxw oedmr0SarM7uVK/z4Diet9ylcY/JqkOfJqs0NkOQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Walle , Krzysztof Kozlowski , "David S. Miller" , Sasha Levin Subject: [PATCH 5.15 127/167] NFC: nxp-nci: dont print header length mismatch on i2c error Date: Tue, 19 Jul 2022 13:54:19 +0200 Message-Id: <20220719114708.888107610@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114656.750574879@linuxfoundation.org> References: <20220719114656.750574879@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.8 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 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: Michael Walle [ Upstream commit 9577fc5fdc8b07b891709af6453545db405e24ad ] Don't print a misleading header length mismatch error if the i2c call returns an error. Instead just return the error code without any error message. Signed-off-by: Michael Walle Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/nfc/nxp-nci/i2c.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c index e8f3b35afbee..ae2ba08d8ac3 100644 --- a/drivers/nfc/nxp-nci/i2c.c +++ b/drivers/nfc/nxp-nci/i2c.c @@ -122,7 +122,9 @@ static int nxp_nci_i2c_fw_read(struct nxp_nci_i2c_phy *phy, skb_put_data(*skb, &header, NXP_NCI_FW_HDR_LEN); r = i2c_master_recv(client, skb_put(*skb, frame_len), frame_len); - if (r != frame_len) { + if (r < 0) { + goto fw_read_exit_free_skb; + } else if (r != frame_len) { nfc_err(&client->dev, "Invalid frame length: %u (expected %zu)\n", r, frame_len); @@ -166,7 +168,9 @@ static int nxp_nci_i2c_nci_read(struct nxp_nci_i2c_phy *phy, return 0; r = i2c_master_recv(client, skb_put(*skb, header.plen), header.plen); - if (r != header.plen) { + if (r < 0) { + goto nci_read_exit_free_skb; + } else if (r != header.plen) { nfc_err(&client->dev, "Invalid frame payload length: %u (expected %u)\n", r, header.plen); -- 2.35.1